johnsturgeon / plex-tools

Utilities and scripts for plex using the Plex API
MIT License
12 stars 0 forks source link

Feature Request: Sync ratings to and from Plex Database to IDv3 tags #14

Open cochraneserver opened 2 months ago

cochraneserver commented 2 months ago

I'm currently going through the process of tagging my ~10k track library but am worried as I know my plex library may not last forever. Ten years is a good run for many software applications.

Any way - it would be awesome to have the ability to sync track ratings from the plex database into mp3 IDv3 rating tag. I've seen some discussion regarding exacltly which tag ratings are stored in, as it can differ between media library applications such as MediaMonkey / MusicBee / AIMP. Perhaps the rating field could be user-definible to make this feature more adaptable.

According to id3.org the rating tag is the "Popularimeter" field - https://id3.org/id3v2.3.0.

johnsturgeon commented 2 months ago

From what I can tell, there is quite the debate about whether ratings should by written to id3 / Vorbis (for folks with Opus / flac files). Each have their own way of storing that information.

Honestly though, I can see the appeal to have a way to do that. Having all your metadata in id3 tags is compelling, but you'd have to also maintain the script to always 'sync' your ratings that you set in Plex back to the file itself, or vice-versa?

My gut tells me that it might be better for there to be an 'export' that could dump your ratings to some kind of .json file that could then be re-imported.

cochraneserver commented 2 months ago

For my use case, if there was a script I could just pass it the id3 tag to sync to/from and use cron to handle scheduling (or just run manually).

My concern is also not just the longevity of my plex database, but also plex itself. In 5 years I may want to switch to something else so having the rating stored in the mp3 would be ideal.

As far as other id3 tags - all my other metadata changes are done outside of Plex and then I just refresh the metadata on the library. Refreshing the metadata on 10k tracks used to be a big hurdle using a NAS with SMR drives but now it completes in about 30 minutes with new drives/NAS.

johnsturgeon commented 2 months ago

Gotcha.

So, do you have plex set to "prefer local metadata" ? It sounds like, in your scenario, you do.

cochraneserver commented 2 months ago

That's correct

Prefer local metadata Genres - Embedded Tags Album Art - Both Plex Music and Local Files

johnsturgeon commented 2 months ago

Gotcha, I think that there's an opportunity here for 'prefer local metadata' scripts, where we push various information into the files for portability.

Syncing is a difficult thing to 'get right' and depends on so many things. I'm kind of imagining two scripts:

  1. Sync rating from Plex -> songs
  2. Sync rating from song -> Plex

the first one could be scripted / cron job and the second one would be manual that you would run if you import new songs that have ratings, or you modify the rating outside of Plex.

cochraneserver commented 2 months ago

Yes that sounds great.

cochraneserver commented 2 months ago

Also for my use case at least, I should add, I have multiple libraries and the ability to pick a library would be best

johnsturgeon commented 2 months ago

I have multiple libraries and the ability to pick a library would be best

I'm going to split that out into a separate issue / enhancement #19

alienmare commented 1 month ago

been waiting for someone to do this forever and trying to use some AI to do the script but fail, anyway, please include flac support aswell. I believe FLAC are store in different tag