Showing posts with label Ratings. Show all posts
Showing posts with label Ratings. Show all posts

Tuesday, November 12, 2024

Importing playlists and importing ratings into plex

 

I was recently asked again whether it is possible to import a playlist in .m3u format that exists outside of plex into plex. Also on a regular basis plex users ask whether it is possible to sync track ratings to plex. I have discussed those issues in my blog a while ago but it may be helpful to revisit them now.


Unfortunately, both is not possible out-of-the-box, but there are workarounds. I would like to describe one possible way here. 


Importing playlists

Let us start with importing playlists. Since plex is very picky, you have to proceed very carefully though. The success depends on a number of factors that may be different for each user. That is probably the reason why plex does not offer importing playlists in the first place. 


First of all, it depends on whether plex is running on a Windows or Linux device. In my case, plex runs on a Linux device. So take care that all paths, be it to the .m3u file or  those in the .m3u itself to the .mp3-files comply with Linux conventions. Change the root and any backslashes if you are working in a windows environment for example with the editor. 


Secondly,  I am assuming that the tracks are already in the Plex database and are located at the place mentioned in the m3u. If this is not the case, plex cannot recognize the tracks of course. 


Thirdly, make sure that your .m3u is located somewhere within the folder structure of the Plex library you want the playlist to be added to. If this is not the case, plex cannot see the m3u. 


Now you can use either a curl command or a python script (to be found on github) to import the playlist. I recently tested jaylex32's 's Syncra and it worked well (just make sure that the path to the .m3u is correct, if you are running the .exe on a windows machine. It'll give you a path to the file in windows format and that won't work for a plex server on a linux machine.  


As it may take a while for larger playlists to appear in plex, you may want to reload the playlist view in the web view. 


Importing track ratings

If you want to sync track ratings from the outside world into plex, your first step would be to create one playlist for each rating value, for example one playlist for all your tracks with a Five-Star-Rating. With this playlist, follow the steps to import the playlist to plex. 

As soon as you can see the new playlist, convert it to a collection. You may want to use Casvt's "playlist_to_collection" script for that which is also on github. Once you have the collection, you can tag all the tracks with the rating of your choice. 










Friday, September 15, 2023

Ratings can be exported and saved to the files!

    

                

Ratings can be exported and saved to the files!


Even regular users of plex do not know how ratings they gave to tracks in the music library can be exported and saved in the files. In the past, I have used a workaround which meant to create a playlist with tracks of the same rating, exporting that playlist and import it to a tagger like mp3tag.

While this can be done, there is also the possibility to use a python script which fetches the ratings of the tracks be it in the whole library or just an album or a subset of the library like for example all tracks which were rated in the last week or so.  Once this is working, it is by far a faster method to backup all ratings!

Python is not so difficult as one would expect, especially if you can get mostly helpful hints from chatgpt and the like. For starters you might take a look at some scripts on github. But beware: they usually cannot be used out of the box and must be adapted to your specific use case. 

The wonderful world of filepaths and non-standardized tagging

Under "plex_for_music, you will find two scripts which may serve as a starting point. One is updating the files the ratings of which were updated in plex in the last days, weeks or months, the other takes a different approach and updates all files with plex user ratings in a given range of albums, for example all albums which have A as the first letter in their title. It might be a good idea to start with the latter one to initially update the whole library and then use the former to update from time to time. 

If you take a look at the codes you will see that the first thing you have to do is adapting it to your setting. If there is only one operating system involved, some of the transforming stuff can be deleted. Of course you may have your own folder structure and you have to adapt the script to it. Furthermore, the code to write the rating to the files is specific for the way media monkey works and if you don't use media monkey be aware that other players might take a different approach and change the code accordingly. 

Update: An alternative tool was released lately which looks pretty good might be worth checking out: https://github.com/rfgamaral/PlexMusicRatingsSync

Tuesday, November 29, 2022

Plex for Music: Ratings Workarounds

 

Plex is a great personal streaming service when you use plexamp. Especially if you are using lossless flacs, it can easily replace spotify. However, you soon realize that plex has been created with movies and not music in the minds. I played around with plex in recent months and like to share my experiences with plex and some third party tools or workarounds which can be a great help to improve listening experience even further. 
 
 A word concerning my setup: I use plex on a Synology Nas with an ARM-Processor, so no Docker Installation, no Supersonic functionality on plexamp. At home, I use a Windows Machine to access the plex installation via web. Same applies when using an ipad, either I listen to music, then I use plexamp or I fiddle around, then I access via web. The Ios app of plex just works fine for playing movies (which I don't use much). 


Ratings

How to Save Ratings in id3tags
Plex offers a great way to rate your tracks, for example on the way by using plexamp. The ratings are saved in the database though and not in the id3-tags of the files. You could change that by syncing playlists with your current ratings in plex with your file system, the process is described in my post on playlists. 

How to assign Ratings in a playlist-collection
Say you have a playlist and you want to mass tag all tracks with the same rating. Plex doesn't allow assigning properties like song ratings in a playlist. The workaround is to transform the playlist into a collection. I have described the process in my post on collections. UPDATE: You can also use a python script specifically written for that usecase which can be found here.