dsaran Posted August 24, 2012 Share Posted August 24, 2012 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 More sharing options...
maxmp Posted September 19, 2012 Share Posted September 19, 2012 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 intothe 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.dbThen 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 playlistscontent://com.maxmpz.audioplayer.data/playlists/ID - playlist by IDcontent://com.maxmpz.audioplayer.data/playlists/ID/files - tracks in playlist IDCurrently, 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 trackdata - 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 More sharing options...
flyingdutchman Posted April 27, 2013 Share Posted April 27, 2013 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 linkhttp://forum.powerampapp.com/index.php?/topic/4679-how-to-update-the-Poweramp-playlist-in-android/ Link to comment Share on other sites More sharing options...
flyingdutchman Posted August 3, 2013 Share Posted August 3, 2013 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.