Jump to content

Changing Playlist Content


dsaran

Recommended Posts

Hi,

I'm trying to add new songs to a playlist through the API but I'm having a few problems.

Uri uri = PowerAMPiAPI.ROOT_URI.buildUpon().appendEncodedPath("playlists").appendEncodedPath(playlistId)

.appendEncodedPath("files").build();

ContentValues values = new ContentValues();

values.put("_id", audioId);

return activity.getContentResolver().insert(uri, values);

I also tried this but with no lucky:

Uri uri = PowerAMPiAPI.ROOT_URI.buildUpon().appendEncodedPath("playlists").appendEncodedPath(playlistId).build();

As there is nothing on api demos related to playlists, I'm not sure I'm doing the right thing.

My question is if it is possible to change playlist content through ContentProviders and if so, how do I do it?

Thanks,

Daniel

Link to comment
Share on other sites

  • 4 weeks later...

Generally yes, it's possible - Poweramp's content provider is exposed to 3rd party apps. You'll need to learn Poweramp database schema though to make inserts into

the appropriate table. Note also, that Poweramp 2.1 will have modified schema in regard of playlists, so you may defer the actual release until Poweramp 2.1 (~1.5 months).

You can get Poweramp db via: adb pull /data/data/com.maxmpz.audioplayer/databases/folders.db

Then you can do sqlite3 folders.db on local machine and check the schema (folder_playlists, folder_playlists_entries).

Poweramp playlists content provider uris:

content://com.maxmpz.audioplayer.data/playlists - all playlists

content://com.maxmpz.audioplayer.data/playlists/ID - playlist by ID

content://com.maxmpz.audioplayer.data/playlists/ID/files - tracks in playlist ID

Currently, playlists is just a keys to folders_files table, which is a collection of actual tracks info.

Thus to insert track into Poweramp list you need:

1. have it under Poweramp available folders (there should be entries for the track in folder_files table)

2. insert appropriate folder_files._id into playlists table.

From Poweramp v2.1, playlists will be an isolated de-normalized table, which will contain track

data - i.e. path, track title/artist/album/duration. This is needed to keep Poweramp 2.1 playlists independent from Poweramp Folders selection and Poweramp library.

This also allows easier 3rd party playlist creation - as you need just insert appropriate data into 2 tables, without need to keep all Poweramp songs data properly.

Thanks!

Link to comment
Share on other sites

  • 7 months later...

I guess my question is related to this one.

I have the android track detail but need to find the Poweramp equivalent in the folder_files table using the Poweramp provider exposed.

 

the full question is posted on this forum so follow this link

http://forum.powerampapp.com/index.php?/topic/4679-how-to-update-the-Poweramp-playlist-in-android/

Link to comment
Share on other sites

  • 3 months later...

Dsaran,

thank you for responding to my question. I now have a better understanding.  I just realised that this is where I started.   :)

Did you manage to insert into the table folder_playlists and folder_playlist_entries?

I am following a similar approach but so far without any luck.

Would you like to share your solution? perhaps on stackoverflow???

thanks

:)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...