Jump to content

Poweramp DB extensions?


Recommended Posts

There seems to be a lot of issues on this forum that stem from people wanting the Poweramp DB to work in non-standard ways

My proposition? An extension API for the Poweramp DB. This would allow those who organize their library in strange ways to dictate how their music is displayed (and sorted in some cases).

The normal broadcast intent style plugins are off the table I presume, since the broadcast channel is far too slow for this use case. But given that the database uses SQLite, and you're already linking to LuaJIT to support MILK files. I think you could in theory manage a pretty banging extension API using Lua.

Im imagining an API that works like so

- As scanning is happening, for each file, a Lua function with 3 parameters is being called

    - The type of tag the file has as a String

    - A Lua table containing every one of the raw tags from the file (with standard tags that the DB looks for being denoted with `Std{tag-name}` and being the same for every tag type)

    - A Lua table with other important metadata such as duration

And the return type being a String that will be stored next to the file's entry in the `folder_files` table in the database

- After scanning completes, the scanner disconnects from the database and calls a post processing function which takes 3 parameters

    - The path to the database as a String

    - A String that the extension can use to prefix it's own tables in the database.

The function would simply return void. And would allow the extension to use a library such as lsqlite3 http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki to directly manipulate the database to it's desire.

This would allow every non-standard tagging system under the sun to work with Poweramp. As long as a Lua extension exists for it.

Just throwing this out there, but an extra feature of this API could be the ability to create new categories. Poweramp could look for tables in the DB with a specific naming convention, for example being "{given prefix}_cat_{category name snake case}", then using a predefined table schema, the Lua extension could create new categories in the post processing function

Edited by fnmain
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...