Restore ratings from Beatunes

Brian H's Avatar

Brian H

29 Apr, 2022 08:32 PM

I was screwing around, trying to remove the album auto generated ratings, and accidentally removed all my track ratings (I have 18k tracks). Is there any way to write the ratings I have cached in beatunes back to Music app?

  1. Support Staff 1 Posted by hendrik on 01 May, 2022 07:24 AM

    hendrik's Avatar

    If they are still in beaTunes (i.e. no sync occurred), you’d have to script a solution.

  2. 2 Posted by Brian H on 01 May, 2022 05:51 PM

    Brian H's Avatar

    Hendrik, I assume you mean apple script (never used) vs. bash (extensive experience). Is there any documentation you can point me to that would explain what to script against in beatunes?

    Also, I do use time machine. Is there anything I can restore using TM to get the track ratings back?

  3. Support Staff 3 Posted by hendrik on 01 May, 2022 06:14 PM

    hendrik's Avatar

    I assume you mean apple script (never used) vs. bash (extensive experience). Is there any documentation you can point me to that would explain what to script against in beatunes?

    No, I meant https://www.beatunes.com/en/beatlet-getting-started.html

    Also, I do use time machine. Is there anything I can restore using TM to get the track ratings back?

    That might be the smarter approach. I.e. trying to restore earlier versions of both your files and the iTunes/Music databases.

  4. 4 Posted by Brian H on 01 May, 2022 06:27 PM

    Brian H's Avatar

    Right, regarding the TM solution, I was under the impression track ratings were written to the database, not the file, is that your understanding? If it's the database, how do I restore that? Is it a flat file somewhere?

  5. Support Staff 5 Posted by hendrik on 02 May, 2022 12:29 PM

    hendrik's Avatar

    Frankly, I don't know for sure from the top of my head, whether iTunes/Music writes ratings to the files or not (I'm sure, it could). If it does, restoring just the database won't help, because it would probably re-import whatever is in the file, as soon as it's played.

    The iTunes/Music database files are in ~/Music (.itdb and .itl files). I have never messed much with them, but reverting to older versions while iTunes/Music is not running, should work. Emphasis on should.

    Please let me know, how this worked out!

  6. 6 Posted by Brian H on 02 May, 2022 05:19 PM

    Brian H's Avatar

    Hendrik, I quit Music, killed any music related processes, then restored the contents of ~/Music/Music/Music Library.musiclibrary/. It didn't restore the ratings. I then restored a single file and that also did not bring back my previous track rating. I used the strings against the mp3 (metadata is usually in the first 10 lines) and found nothing related to ratings. I also examined a file with VLC and found no metadata for ratings.

    I think at this point I need to somehow sync my beatunes cached ratings to Music.

  7. Support Staff 7 Posted by hendrik on 03 May, 2022 03:23 PM

    hendrik's Avatar

    Hm. Weird.

    I then restored a single file and that also did not bring back my previous track rating.

    Did you play the file? Music tends to only read a file once it's played.

    metadata is usually in the first 10 lines

    Depends on the ID3 version.

  8. 8 Posted by Brian on 03 May, 2022 03:30 PM

    Brian's Avatar

    Yep, I played both copies of the file and some others, but no update in the track rating. I also rebooted my system, hoping to shed something that might still have been in memory.

    So, is it possible to sync track ratings FROM beatunes TO Music?

  9. Support Staff 9 Posted by hendrik on 03 May, 2022 03:36 PM

    hendrik's Avatar

    So, is it possible to sync track ratings FROM beatunes TO Music?

    Not out of the box.

    If you still have the old ratings in beaTunes somehow, you could write a LibraryBatchAction that takes the beaTunes rating and tells Music about it. LibraryBatchActions are basically pieces of code that are applied to every entry in your library (so be careful!). You can code them in one of a couple of languages.

    Feel free to play around with it. If you have time, I might be able to code that up in the next couple of days.

  10. 10 Posted by Brian on 03 May, 2022 03:50 PM

    Brian's Avatar

    Thanks. However, I do not write code. I can write shell scripts and some very basic perl, but that is it. I looked through some of the documentation on the site and it's way over my head. If there were some specific calls you could point me to, that might help, but otherwise, I have no idea where to start. I'll probably sort my 18k tracks by play count and go through them one at a time and guesstimate a track rating.

  11. Support Staff 11 Posted by hendrik on 03 May, 2022 04:38 PM

    hendrik's Avatar

    As I said, or at least tried to say:

    if you can wait a couple of days, I can code that for you.

  12. 12 Posted by Brian on 03 May, 2022 06:30 PM

    Brian's Avatar

    Hendrik, I didn't want to impose, but secretly was wishing that would happen. Thank you, I can absolutely wait.

  13. Support Staff 13 Posted by hendrik on 05 May, 2022 08:36 PM

    hendrik's Avatar

    Hey Brian,

    please try to unzip the attached script and place it in the beaTunes Plug-Ins directory (see also here).

    Then restart beaTunes and, if installed correctly, you should see a new menu item under Tools.

    Now, DO NOT just click on that item.

    First make sure, in the beaTunes general preferences, you have
    - Turned off embedding - Turned on force overwriting

    Then ensure that your TM backup is up to date in case things go haywire.

    Then click on that menu item ("Reset Ratings").

    The script will run over all tracks in your library and attempt to write what's in the beaTunes database to Music/iTunes (if the rating has not been computed). This will take a while.

    Hope it helps,

    -hendrik

  14. 14 Posted by Brian Hostetler on 05 May, 2022 09:48 PM

    Brian Hostetler's Avatar

    That worked! Thank you so much!!!

    Brian

        On Thursday, May 5, 2022, 01:36:09 PM PDT, hendrik <[email blocked]> wrote:

    |

  15. Support Staff 15 Posted by hendrik on 06 May, 2022 07:07 AM

    hendrik's Avatar

    Rating restored and all?!
    Awesome. :-)

    Have a great weekend,

    -hendrik

  16. 16 Posted by Brian Hostetler on 06 May, 2022 04:40 PM

    Brian Hostetler's Avatar

    All rating restored and I manually removed the album ratings for good measure. My library is looking great! Thanks so much for your help and I hope you have good, safe weekend, too!

    Brian

        On Friday, May 6, 2022, 12:07:45 AM PDT, hendrik <[email blocked]> wrote:
     
       
    |

  17. Support Staff 17 Posted by hendrik on 16 May, 2022 12:35 PM

    hendrik's Avatar

    You're welcome.
    Glad I could help.

    -hendrik

  18. hendrik closed this discussion on 16 May, 2022 12:35 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac