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. 










Wednesday, May 22, 2024

Sonic Adventure: How to save it as a playlist and more

 




One of the best features of plex and plexamp is the ability to create a smooth audio journey starting with one track and ending with another after an hour or so. You need a server which is able to do a sonic analysis of the tracks in your library and a plex pass to enjoy the feature. 

If you are happy with the journey, you may want to save the track sequence for later which you can do in plexamp by hitting the three dots at the bottom and save the queue as a playlist. 

Or you can create such a playlist right on the server by using a bit of python. This could prove useful, for example, if the two endpoint-tracks are to be determined by certain criteria, such as their genres, certain moods or the date they were added to the library. Here is a link to a script where the user enters the titles of the start and end tracks and has the opportunity to apply filters such as the user rating, the play count or the track genre. Keep in mind that these filters will shorten the resulting playlist, so the outcome very much depends on the size of your library and the filters you apply. If you want the original length of the playlist, leave all filters simply blank. 

Thursday, May 9, 2024

How can I sort the albums in a plex music library in all artist views by regular albums, live albums and compilations in just a few minutes?

 


 . 

Some time ago I mentioned in a post the possibility of choosing between normal albums, live albums, compilations and singles/EPs in the artist view of plex. This is possible because plex can read the RELEASETYPE tag of the audio file. The whole thing looks quite nice, but that is not all. In the plex library, album view, you can filter according to type, e.g. Compilations, Live Albums, Remixes and so forth and also according to format, e.g. album, single, EP. Plexamp, of course, can look at that as well when creating a playlist. 


Those who prefer the differentiating view are faced with the problem that albums already read by plex often have no corresponding tags. This can be done manually with an editor, e.g. mp3tag, but you have to be very careful that you enter the tags exactly as required (e.g. "album;compilation" for a compilation) plex is very picky. Then you also have to refresh the album. This takes a while, first the album disappears from the row of normal albums, then it is sorted correctly with a little delay when you refresh the view. 


However, you can also automate the process using a python script. The python script asks for the name of the album, changes or adds the 'releasetype' tag in the metadata of mp3, flac and mp4 files and finally refreshes the album in plex so that it is regrouped as a live album, compilation or single/EP. The python script is available here