Pumila Posted July 18, 2023 Share Posted July 18, 2023 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 More sharing options...
andrewilley Posted July 18, 2023 Share Posted July 18, 2023 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 More sharing options...
maxmp Posted July 18, 2023 Share Posted July 18, 2023 @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 More sharing options...
Pumila Posted July 20, 2023 Author Share Posted July 20, 2023 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 More sharing options...
Pumila Posted July 20, 2023 Author Share Posted July 20, 2023 @maxmp What are m3u8 playlists? Can I download them from the Google Play store? Could you provide a link? Link to comment Share on other sites More sharing options...
Pumila Posted July 20, 2023 Author Share Posted July 20, 2023 @andrewilley I wasn't able to fetch the playback count information in the Music Playlist Manager by @flyingdutchman. How can I do that? Link to comment Share on other sites More sharing options...
andrewilley Posted July 20, 2023 Share Posted July 20, 2023 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 More sharing options...
flyingdutchman Posted July 20, 2023 Share Posted July 20, 2023 @Pumila playcount gets written to the Poweramp database at the same time, together with ratings. My app will only handle .mp3 tracks though. In fact the ratings tag (known as POPM tag) has the following structure email, rating, timesplayed for the email I use flyingdutchman@nowhereland.nl Link to comment Share on other sites More sharing options...
Pumila Posted July 21, 2023 Author Share Posted July 21, 2023 @flyingdutchman @andrewilley Am I correct in understanding that the Music Playlist Manager cannot retrieve information on the number of times a song has been played? Does that mean I should ask @flyingdutchman to make it possible to retrieve this information? Link to comment Share on other sites More sharing options...
andrewilley Posted July 21, 2023 Share Posted July 21, 2023 @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 More sharing options...
Pumila Posted July 21, 2023 Author Share Posted July 21, 2023 @andrewilley I tried opening the mp3 file, but I was unable to retrieve the number of playbacks even with the mp3 file. Link to comment Share on other sites More sharing options...
andrewilley Posted July 21, 2023 Share Posted July 21, 2023 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 More sharing options...
Pumila Posted July 21, 2023 Author Share Posted July 21, 2023 @andrewilley Hmm, I wonder if it's difficult. I'm thinking about contacting the Poweramp official support to ask where the database is saved and whether it can be disclosed. Do you know how I can get in touch with the official support? Link to comment Share on other sites More sharing options...
flyingdutchman Posted July 21, 2023 Share Posted July 21, 2023 @Pumila the database is available and accesible through the api. My app reads and writes to it. This is the table you are interested in Link to comment Share on other sites More sharing options...
andrewilley Posted July 21, 2023 Share Posted July 21, 2023 PA's database is stored in root location /data/data/com.maxmpz.audioplayer, but you can access its contents from your own app via the provided API. See the documentation and discussion in https://forum.powerampapp.com/forum/8-external-api/ if you want to write something. Andre Link to comment Share on other sites More sharing options...
Pumila Posted July 22, 2023 Author Share Posted July 22, 2023 @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. Link to comment Share on other sites More sharing options...
Pumila Posted July 22, 2023 Author Share Posted July 22, 2023 @andrewilley Is the location shown in the attached image correct? There are no files inside though. I wonder if it's because I don't have the permissions to view anything. I'd appreciate it if you could enlighten me. Link to comment Share on other sites More sharing options...
flyingdutchman Posted July 22, 2023 Share Posted July 22, 2023 @Pumila it also needs permissions to read playlist_manager AND your music folders of course. Please read the initial instructions carefully Link to comment Share on other sites More sharing options...
Pumila Posted July 22, 2023 Author Share Posted July 22, 2023 @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. Link to comment Share on other sites More sharing options...
andrewilley Posted July 22, 2023 Share Posted July 22, 2023 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: Some file manager apps will be able to access it and show/edit content. Andre Link to comment Share on other sites More sharing options...
flyingdutchman Posted July 22, 2023 Share Posted July 22, 2023 @Pumila my app (and other apps with android 10 and above) cannot access folders that belong to another app unless google has allowed this eg file managers. Not sure why you would want access. You get access through the api whch is available on github Link to comment Share on other sites More sharing options...
Pumila Posted July 23, 2023 Author Share Posted July 23, 2023 @flyingdutchman I've found a place where I might be able to sort by the number of plays. How can I export this information? Also, how do I access the table below? Link to comment Share on other sites More sharing options...
flyingdutchman Posted July 23, 2023 Share Posted July 23, 2023 @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 More sharing options...
Pumila Posted July 23, 2023 Author Share Posted July 23, 2023 @flyingdutchman Should I use MediaSessionCompat? However, I don't quite understand how to use MediaSessionCompat. Could you provide the steps or code that you outlined in a table? I'm a beginner with Android API, so I don't know anything. Thank you in advance. Link to comment Share on other sites More sharing options...
flyingdutchman Posted July 23, 2023 Share Posted July 23, 2023 @Pumila best to communicate by email as this is not really Poweramp related Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now