Jump to content

Playlist sorting should stay in the mode selected (or offer an option)


Recommended Posts

RLanger7228
Posted

As I organize my collection in Emby after "importing" it from Synology Video Station, I have been assigning various videos to different playlists.  Thousands of videos is taking quite some time, since additions are in small groups as I get time to dedicate to this project amongst life's other duties.  There are several options for sorting, though I prefer alphabetically by title.  However, no matter how many times I select the title option for sorting, it seems to revert back to the order in which they are added to the playlist after new titles are added.  It seems to retain the alphabetical title order for the films added earlier, but the newly added films always appear at the end of the list, without automatically being sorted by title as I originally requested.  I can re-sort by title after adding, but when I add more films at a later date, they always appear at the end of the list.

It would be nice if the sorting function either automatically maintained the selected sorting preference, or at least had a "toggle-able" option to "maintain this sort order preference as new titles are added", or equivalent language.

Posted

Hi, can you please provide a specific example? Adding an item to a playlist should not impact the selected sort order.

RLanger7228
Posted

I must apologize.  As I was adding new titles to various playlists that I (thought I) had already defined with a sort order, I saw the new titles at the end of a list, when they should have been sorted higher in the list.  It seems as though Emby would "default" back to the order they were added.  When I specifically tried to re-create this problem in a controlled fashion, adding to a playlist I know is sorted by title, the newly added film DID come up sorted properly.

I made this post because I was certain that the sort criteria I assigned had changed.  I will now set the sort order of ALL my playlists to my desired criteria.  When I add new titles, I will look to see if any of the playlist sort criteria are changed.  If I see any changes, I will re-post here & upload a log file, so you can see if there is anything "funny" that Emby is doing.

Thank you.

  • Thanks 1
RLanger7228
Posted

I found this file through an Apple Support forum.  However, it is scripting someone else wrote, so I am cautious about using it.  Also, I am not familiar with scripting & don't know how to implement it, even if it is legit & safe, nor how to read through it to make sure there is no malicious scripting.

ExportM3ULists.vbs

  • 3 weeks later...
Posted

ExportPlaylist.vbs

😀

This is the script that I use to export playlists from itunes to emby.  If you wanted to make it work for you, just update line 99 to the directory that Emby scans.

Output="U:\playlists

To use it, have itunes open to the selected playlist and run the script. It will overwrite the existing playlist if you run it multiple times. 

  • Thanks 1
RLanger7228
Posted

Thank you!  You did a nice job of formatting & commenting, making it easy to follow.  I was able to open it in Xcode & found the section you were referring to (SS).

I have  few questions:

Line 97:  "original path to location of each song" - currently has the value of "\U:".  I assume this would be the file path of where the actual music is located on my HD.  You mention this as the path to the songs, but I have songs organized as ARTIST>ALBUM>SONGS.  Playlists with many artists would have different file paths to each song.  If this is set once, how can it access everything?

Line 98: "Updated path that Emby uses" - current value "..\".  Wouldn't this need to be unique to my system?  Also, my Emby is running on a NAS whereas the script would be running on my laptop.  I COULD map the NAS to my computer as an external HD?

Line 99:   This is the line you said I needed to edit.  I assume this should be the file path where Emby would look for playlists on my NAS?  Since I am running this script on my MacBook laptop, perhaps I should select/create a destination folder on my laptop, then upload it to the appropriate folder on my NAS?

 

I have "old" experience with programming (mostly BASIC, some 6502 assembler, some DBASE 4 & dabbling in Swift with Xcode).  I have never used scripts, per se.  I am not even sure how to run this script (just double click to open it?).  I think you mentioned that I should have Apple Music open, with the playlist in mind displayed.  Is there anything else I need to do?  Also, the reference to \u:  makes me think this was written on a PC.  Will this script even run on a Mac?

 

 

Screenshot 2024-12-30 at 10.58.27 AM.png

Posted

All of my media is on the same server as Emby is running, but is accessed through UNC paths. 

image.png.248ddfc90883662be67d0c5648f5cd6e.png

But on my desktop, it's Mapped drive U:\

The Original path is where iTunes sees the music.  I'm running iTunes on a desktop with a mapped network drive, u:\. If i export a playlist from iTunes, i see this:

image.png.79d56b556bd5769f256da04ae2a31902.png

But, if i look at the playlist that's exported from the script, I see this:

image.png.8598986c0a26b3337a2ae3869a513f96.png

From the point of view of Emby, which sees the playlists in a folder, called Playlists, all of the music is located in folders within the parent directory, "..\".  if there was additional navigation to get from playlists to your music library, that's what would go here.  But to keep the scanning pathing simple and have playlists contained in the music library, i chose a subfolder of my music directory. 

The output is the location of the playlists, from where the script is being called. 

image.png.5225b029dc973634e8145d1df2580715.png

 

Basically the script is a bloated way of exporting the selected playlist within iTunes, that changes the pathing on the export and saves the file in the desired location with feedback to the user.  But, this won't run on a mac, unless you're running a VM.  If set up similarly, you could just export the playlist manually, and replace the U:\ with a ..\ and save it in your music directory in a folder called playlists. 

I'm a software engineer that hasn't used a mac in 24 years of development; all .net, c++, python or scripting.  

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...