Jump to content

Listing Poweramp playlists by name


MohammadAG

Recommended Posts

Hi,

 

I'm trying to make an app that would need to list Poweramp's playlists along with their names.

Querying the content provider for content://com.maxmpz.audioplayer.data/playlists returns me this:

D/Poweramp(10779): Listing playlistsD/Poweramp(10779): _idD/Poweramp(10779): 14D/Poweramp(10779): 12D/Poweramp(10779): 4D/Poweramp(10779): 2D/Poweramp(10779): 1D/Poweramp(10779): 3D/Poweramp(10779): 7D/Poweramp(10779): 8D/Poweramp(10779): 5D/Poweramp(10779): 9D/Poweramp(10779): 11D/Poweramp(10779): 13D/Poweramp(10779): 10D/Poweramp(10779): 6

Which are IDs, my question is, how do I query for the name? The database has that in the table "folder_playlists" under column "name".

Caused by: java.lang.IllegalArgumentException: Unknown URI content://com.maxmpz.audioplayer.data/playlists/11
Link to comment
Share on other sites

  • 4 months later...

 public  Cursor getpampPlaylistcursor(Context context,Cursor cursor)

      {

//              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

     //  

//              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

 

           String[] proj = { "_id", "name"};

            final     Uri playlistUri = Uri.parse("content://com.maxmpz.audioplayer.data/playlists");

            Cursor playlistCursor = getContentResolver().query(playlistUri, proj, null, null, null);

     return playlistCursor;

      }

          

 

This is as far as I got as Poweramp does not provide anything else to allow you to write/amend playlists.

 

Check out my threads on this forum as this has a lot more:

 

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

Link to comment
Share on other sites

Although it is not possible to update the Poweramp playlist, I did manage to interrogate the database and return values


In its simplest form:


final String pamptrack_id = "folder_files._id";


final String pamptrack_no = "folder_files.track_number";


final String pamptrack_name = "folder_files.name";


final String pampartist = "artists.artist";


final String pampduration = "folder_files.duration";


final String pampalbum = "albums.album";


final String pampyear = "folder_files.year";


final String pamppath = "folders.path";


final String pamprating = "folder_files.rating";


final String pamptimes_played = "folder_files.played_times";


final String pamplast_played = "folder_files.played_at";


final Uri uri = Uri.parse("content://com.maxmpz.audioplayer.data/files");


 


 


public Cursor getpampTrackTrackcursor(Context context, Cursor cursor)


{


// gets all tracks


ContentResolver cr = context.getContentResolver();


String[] proj ={ pamptrack_id, pamprating,pamptimes_played, pamplast_played };


cursor = cr.query(uri,proj,null,null,null);


return cursor;


}


 


go


https://play.google....stmanager&hl=en


to see this is action

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...