flyingdutchman Posted April 25, 2015 Share Posted April 25, 2015 Any app developers out there who can help.?In my app New Playlist Manager (http://www.playlistmanager.webspace.virginmedia.com/npm/), I am trying to provide a means to update specific Poweramp tags such as Rating, Times Played and Last Time Played. This will help those who migrate phones/devices and want to retain their Poweramp tags. For this to work, I have an export routine from Poweramp (old Phone/device) and also an import into Poweramp (new phone/device). Export works fine, Import I need some help as I am not sure how I can update each record. The code to parse the export file is complete apart from the code to update. Part 1 Export Poweramp details to text file works fine public void export_pamp_details(Cursor crsor) throws IOException { int int_name = crsor.getColumnIndex(pamptrack_name); int int_rating = crsor.getColumnIndex(pamprating); int int_times_played = crsor.getColumnIndex(pamptimes_played); int int_last_played = crsor.getColumnIndex(pamplast_played); if (plist.check_folder(myfolder)) { try { myFile.createNewFile(); } catch (Exception e) { Log.i(TAG, e.getMessage()); }FileOutputStream fOut = new FileOutputStream(myFile);OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut);String line = "";for (crsor.moveToFirst(); !crsor.isAfterLast(); crsor.moveToNext()) { line = "\""+crsor.getString(int_name)+"\"" + ","+"\""+crsor.getString(int_rating)+"\"" + ","+"\""+crsor.getString(int_times_played)+"\"" + ","+"\""+crsor.getString(int_last_played)+"\""+"\n"; myOutWriter.append(line); } try { crsor.close(); myOutWriter.close(); fOut.close(); } catch (Exception e) { } }} Result:"01. Cruel World.mp3","0","5","1421584583""02. Ultraviolence.mp3","0","2","1421588250""04. Brooklyn Baby.mp3","0","0","0""05. West Coast.mp3","0","0","0""06. Sad Girl.mp3","0","0","0" Part 2 Import into Poweramp public void import_poweramp_details(Context context) throws IOException {// load text file// for each line, find the track in the pamp database// if cursor is returned then update that recordBufferedReader reader = new BufferedReader(new FileReader((String.valueOf(myFile))));try { String line;while ((line = reader.readLine()) != null) { String[] RowData = line.split(","); String name = RowData[0]; String rating = RowData[1]; String times_played = RowData[2]; String last_played = RowData[3]; String where = pamptrack_name +" =?"; String criteria[] = {name }; Cursor pampcursor = getthispampTrackcursor(context, where, criteria ); if(pampcursor.moveToFirst() && pampcursor != null){>>>>> here I have the correct track record, >>>>> I have all the necessary details>>>>> How to update record?? }Log.i(TAG,name +rating+times_played+last_played);}}catch (IOException ex) {// handle exception}}} Now I know from previous posts that the api does not provide an interface to update.A) Is this assumption still correct? is there away to achieve this update?C) perhaps Poweramp developers can help? Link to comment https://forum.powerampapp.com/topic/7763-updating-poweramp-rating-last-played-times-played-help-needed/ Share on other sites More sharing options...
SDW Posted September 6, 2015 Share Posted September 6, 2015 Bumping for interest. Link to comment https://forum.powerampapp.com/topic/7763-updating-poweramp-rating-last-played-times-played-help-needed/#findComment-29678 Share on other sites More sharing options...
flyingdutchman Posted August 9, 2016 Author Share Posted August 9, 2016 Figured it OUT !! Thenext release of New Playlist Manager will allow you to EXPORT and IMPORT your RATINGS, Times Played and Last Played. Watch this space. Link to comment https://forum.powerampapp.com/topic/7763-updating-poweramp-rating-last-played-times-played-help-needed/#findComment-35399 Share on other sites More sharing options...
flyingdutchman Posted August 10, 2016 Author Share Posted August 10, 2016 Version 62 has been released and has now functionality to export and import your ratings. Link to comment https://forum.powerampapp.com/topic/7763-updating-poweramp-rating-last-played-times-played-help-needed/#findComment-35413 Share on other sites More sharing options...
flyingdutchman Posted October 6, 2018 Author Share Posted October 6, 2018 Further update. Now that Poweramp v799 has been released all playlst functionality is available, create, insert, delete, merge, sort etc Link to comment https://forum.powerampapp.com/topic/7763-updating-poweramp-rating-last-played-times-played-help-needed/#findComment-61112 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.