Jump to content

Regarding the location of the play count database


Pumila

Recommended Posts

Content: I'm using an app called "iSyncr" that can sync iTunes and Android, but the number of times played on Android doesn't reflect well on iTunes.
I found out that to sync the play count, I can edit the xml file of iSyncr, but the crucial database of the play count on Android doesn't exist.
I know that "Poweramp" saves the play count, but is there any way to access that information? It might be confidential, but I really want to sync the play count accurately. I would really appreciate your help.
Thank you in advance.

Link to comment
Share on other sites

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Poweramp's Play Count is stored in an internal database, it is not written back to files at all. @flyingdutchman 's Music Playlist Manager is able to read the database content via the public API, and it might be able to write the count back to the POPM tag (used for Ratings & Play Counts) in audio files, but I have no idea whether iSyncr reads that tag or not (Poweramp does not).

Even if you did do this, it would be a one-shot process, it would not continue to sync updates over time. You would need to write your own app to regularly interrogate PA for any changes via the API, not a trivial task.

Andre

Link to comment
Share on other sites

@Pumila also these can be exported/imported via Settings / Export/Import Settings/Data options. (Also ratings can be exported/imported via m3u8 playlists). There are plans to add support for a better mass tag editing as well, and when this is implemented, there will be an option to write rating to files as well - but that will never be 100% safe as internal database ratings are (as on mobile/phone device, we can't 100% guarantee file will be written fully and properly).

Link to comment
Share on other sites

I'm using iSyncr to synchronize Android and iTunes. However, due to a setting issue, I couldn't sync the play count. I found out that by editing the xml file, I can sync the play count. So, I'm saving the play count with Poweramp, but could I get information about that database? It might be confidential information, but I want to sync the play count. Please help.

Link to comment
Share on other sites

1 hour ago, Pumila said:

@maxmp What are m3u8 playlists? Can I download them from the Google Play store? Could you provide a link?

They are playlist files, like M3U, PLS, WPL, or whatever file format your audio application uses for its generated playlists. Just a list of songs and the order they should be played in. They are not relevant to this discussion though, as Play Counts are not included with Poweramp's exported playlist files (although ratings are included).

As for Music Playlist Manager, you'd need to wait for @flyingdutchman to respond. But even then, that probably won't help with iSyncr unless (a) MPM includes play counts as well as ratings as part of its handing of POPM tags in your MP3 files, and (b) iSyncr reads those POPM tags back from audio files each time. And even if all of that works, it'd still be a one-shot process, it wouldn't continue to re-sync over time.

Poweramp does provide access to its SQL database and content via API calls, but you'd need to write an app to support that - just like Theo has done.

Andre

Link to comment
Share on other sites

@Pumila As Theo said, while MPM can read PA's play count, it is only processed by his app for MP3 files.

You have an Apple M4A file there, which as far as I know doesn't support embedded play count tags at all.

To be honest, Play Count is generally regarded as a somewhat transient piece of information, basically local to the currently used app. While it can be written to the POPM tag in MP3 files (and PCNT too in more recent ID3 variants) and to FLAC/Vorbis, it's usually associated with an email field to avoid it being irrelevantly read by other users. It's not very well supported all round.

Andre

Link to comment
Share on other sites

30 minutes ago, Pumila said:

@andrewilley I tried opening the mp3 file, but I was unable to retrieve the number of playbacks even with the mp3 file.

If a play count is stored in an MP3 file at all, it will most likely be in the POPM tag (which is more commonly used for its main purpose of ratings). But very often it won't be present. And PCNT is even less supported, I didn't even know it existed until I did some searching. As both Rating and Play Count are personal matters, they are unlikely to be included in any distributed files.

[Edit] Out of curiosity, I checked my whole 'Singles' folder, and out of 1,500 or so rather eclectic audio files sourced from all over the place, only one had a POPM tag at all, and that contained a rating value of 255 (i.e. 5 stars) and no play count. Interestingly, the email part was set to "Windows Media Player 9 Series", so clearly treated as just a placeholder.

  | Popularimeter = Windows Media Player 9 Series 255 0
  | - Tag 'POPM' (31 bytes):
  |     016a: 57 69 6e 64 6f 77 73 20 4d 65 64 69 61 20 50 6c [Windows Media Pl]
  |     017a: 61 79 65 72 20 39 20 53 65 72 69 65 73 00 ff    [ayer 9 Series..]

 

@flyingdutchman if you are transferring any play counts from Poweramp's database and embedding them, perhaps it might be worth using something like "Poweramp Build xxx" in that field, to indicate the original source? 

Andre

Link to comment
Share on other sites

@flyingdutchman I'm really sorry. I know I should be looking this up myself, but how can I access that screen from the Music Playlist Manager? Can I access it from "FilePicker"? It's saying I don't have permission and nothing is displayed. I've given access permissions to the folder though. Would it require rooting? I would appreciate it if you could tell me. Thank you.

Screenshot_2023-07-22-16-20-28-267_com.flyingdutchman.newplaylistmanager.jpg

Link to comment
Share on other sites

@flyingdutchman I apologize. I read the user's guide, but I couldn't figure out how to access the folder where the target table is located. I have given the necessary permissions as shown in the attached image (sorry it's in Japanese), but nothing is displayed. Is there something wrong with the settings? I would appreciate it if you could explain in detail.

Screenshot_2023-07-22-16-40-37-004_com.google.android.documentsui.jpg

Screenshot_2023-07-22-16-40-57-516_com.flyingdutchman.newplaylistmanager.jpg

Link to comment
Share on other sites

27 minutes ago, Pumila said:

@andrewilley Is the location shown in the attached image correct? There are no files inside though.

Android/data/com.maxmpz.audioplayer is Poweramp's user data folder. It's where things like user-downloaded cover artwork is cached in the following subfolders:

image.png

 Some file manager apps will be able to access it and show/edit content.

Andre

Link to comment
Share on other sites

@Pumila you create playlists by selecting the relevant "times Played" The + button at the top will ask you for a playlist name.

The table is accessed by using the api (https://github.com/maxmpz/powerampapi/tree/master/poweramp_api_lib) which is what Music Playlist Manager does.

You cannot access it directly.

 

If you are into java programming

public Cursor getPowerampTrackcursor(Context context, String where, String sort_order) {

 
      String[] proj = {pamptrack_id,
            pamptrack_name,
            pampalbum,
            pampartist,
            pamprating,
            pampduration,
            pamppath,
            pamptimes_played};
      try {
         Cursor cursor = context.getContentResolver().query(powerampuri, proj, where,
               null, sort_order);
         return cursor;
      } catch (Exception e) {
         e.printStackTrace();
      }
  
 
}

this is what it actually  does 

SELECT folder_files._id, folder_files.name AS name, folder_files.artist_id AS artist_id,duration, rating, artists.artist, albums.album, folders.path FROM folder_files INNER JOIN folders ON folders._id=folder_id  LEFT JOIN albums ON albums._id=folder_files.album_id LEFT JOIN artists ON artists._id=folder_files.artist_id  WHERE (folder_files.cue_folder_id IS NULL)  ORDER BY folder_files.title_tag COLLATE NOCASE 

Uri powerampuri =  PowerAMPiAPI.ROOT_URI.buildUpon().appendEncodedPath("files").build();

 String[] proj ={ pamptrack_id, pamptrack_name, pampartist,pampduration,pampalbum, pampyear, pamppath, pamptrack_no,pamprating };

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