Jump to content

Genre and Composer Uris


flyingdutchman
 Share

Recommended Posts

@maxmp the table folder_files contains the genre_id and composer_id but when a user searches for eg genre="rock" and composer ="satriani" the string would first need to be translated into an _id. 

Using the uri

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

will return the genre string "rock" but cannot show the composer string

conversely, using the 

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

will return the composer string "satriani"  but not genre.

Is it at all possible in the next release to expand either uri to return both genre and composer strings?

The query below an example of  the dataset I am looking for

SELECT  
folder_files._id,
 folder_files.album_id,
 albums.album,
 folder_files.artist_id,
 artists.artist,
 folder_files.album_artist_id, 
folder_files.bit_rate, 
genres._id, genres.genre,
 folder_files.played_at,
 folder_files.created_at,
 folder_files.played_at,
 folder_files.played_times,
 folder_files.duration, 
folder_files.name,
 folder_files.name_without_number,
 folder_files.composer_id ,
 composers.composer,
 folder_files.track_number,
 folder_files.year
 FROM 
genre_entries 
INNER JOIN genres ON genres._id=genre_entries.genre_id  
INNER JOIN composers ON  folder_files.composer_id=composers."_id"
INNER JOIN folder_files ON folder_files._id=genre_entries.folder_file_id  
INNER JOIN folders ON folders._id=folder_files.folder_id  
LEFT JOIN albums ON albums._id=folder_files.album_id 
LEFT JOIN artists ON artists._id=folder_files.artist_id ;

 

 

Link to comment
Share on other sites

It requires joins between multiple tables, preferable left joins, as inner join will return just entries with both genres and composers, while there can be track without those at all.
 

As Poweramp has no use for genres + composers (and other possible combinations), it’s not implemented.

I would suggest just importing track data into your local db and doing the joins as needed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...