Jellyfin Forum
Display Order not changing Play Order? - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: Display Order not changing Play Order? (/t-display-order-not-changing-play-order)



Display Order not changing Play Order? - sapce - 2024-10-06

Sorry if I'm phrasing this in a confusing way. When I change the "Display Order" to DVD, it doesn't actually move around the episode order, just their names/info in the jellyfin ui. I was wondering if this is intentional or if there is a way to change the play order with the display order? (without renaming/reording the files to Sonarr).

Thanks!


RE: Display Order not changing Play Order? - TheDreadPirate - 2024-10-06

Jellyfin will not change file names when you change the display order. It has no way of actually determining what episode is actually in the file. It assumes that you have the files named to correspond with your selected ordering.


RE: Display Order not changing Play Order? - sapce - 2024-10-06

(2024-10-06, 10:09 PM)TheDreadPirate Wrote: Jellyfin will not change file names when you change the display order.  It has no way of actually determining what episode is actually in the file.  It assumes that you have the files named to correspond with your selected ordering.

Hi, thanks for replying. I don't want/need Jellyfin to change the filenames, just to play the corresponding media when changing the "Display order".

So when I switch the "Display order" from "Aired" to "DVD", "Cowboy Bebop - 1x01 - Stray Dog Strut.mkv" is now displayed as Episode 2, and "Cowboy Bebop - 1x13 - Asteroid Blues.mkv" is display as Episode 1, which is what I want. But when I select Episode 1 Asteroid Blues in Jellyfin, it plays Stray Dog Strut. Is this intended and/or is there a way to actually change to the corresponding episode being played when changing the "Display order" to the new order?


RE: Display Order not changing Play Order? - TheDreadPirate - 2024-10-07

You will need to rename the files. Specifically the episode number. Because you named the file 1x01 it will be identified as the first episode in the order you selected, the episode name is pretty much ignored.

The file season and episode numbers in the file names must always match the metadata source and order you are using.

I also have the Cowboy Bebop bluray boxset and Asteroid Blues is named "s01e01.mkv" and Stray Dog Strut is "s01e02.mkv", etc. Jellyfin will always honor the season and episode number in the file name and match it up with the metadata from the episode order you selected. It will not assume "oh, you actually mean this", because it has no way of knowing what you actually mean.

When the orderings differ a lot between orderings, this can mean opening every video and skipping past the opening to the episode name since they aren't named when ripping them.

Due to some oddities with my Daria boxset, I had to open all 65 episodes and skip the opening to ensure the files were named right.

There are some tools you can try. Tiny Media Manager MIGHT have a way to rename them automatically.


RE: Display Order not changing Play Order? - sapce - 2024-10-07

(2024-10-07, 02:03 AM)TheDreadPirate Wrote: You will need to rename the files.  Specifically the episode number.  Because you named the file 1x01 it will be identified as the first episode in the order you selected, the episode name is pretty much ignored.

The file season and episode numbers in the file names must always match the metadata source and order you are using.

I also have the Cowboy Bebop bluray boxset and Asteroid Blues is named "s01e01.mkv" and Stray Dog Strut is "s01e02.mkv", etc.  Jellyfin will always honor the season and episode number in the file name and match it up with the metadata from the episode order you selected.  It will not assume "oh, you actually mean this", because it has no way of knowing what you actually mean.

When the orderings differ a lot between orderings, this can mean opening every video and skipping past the opening to the episode name since they aren't named when ripping them.

Due to some oddities with my Daria boxset, I had to open all 65 episodes and skip the opening to ensure the files were named right.

There are some tools you can try.  Tiny Media Manager MIGHT have a way to rename them automatically.


Thanks, that's what I figured. but was hoping Jellyfin somehow kept track how the episodes were rearranged and when 1x15 file displays as 1x01, it knows to play 1x15. and luckily Cowboy Bebop/Asteroid Blues starts with that prologue so it can be quick to tell if there's ordering issue haha. The only reason mine was arranged in this way is because I use Sonarr for media management (which uses TVDB). I ended up using a script I made with the help of chatgpt for fixing the files and giving them the original airing metadata. Here's a table I made with the info I found and here's the powershell script if you're curious:
Code:
# Define the mapping of episode numbers to their respective air dates
$episodeDates = @{
    '01' = '1998-10-23 01:00:00'
    '02' = '1998-04-03 18:00:00'
    '03' = '1998-04-10 18:00:00'
    '04' = '1998-11-13 01:00:00'
    '05' = '1998-11-20 01:00:00'
    '06' = '1998-11-27 01:00:00'
    '07' = '1998-04-17 18:00:00'
    '08' = '1998-04-24 18:00:00'
    '09' = '1998-05-01 18:00:00'
    '10' = '1998-05-08 18:00:00'
    '11' = '1998-05-15 18:00:00'
    '12' = '1998-05-22 18:00:00'
    '13' = '1998-05-29 18:00:00'
    '14' = '1998-06-05 18:00:00'
    '15' = '1998-06-12 18:00:00'
    '16' = '1999-02-12 01:00:00'
    '17' = '1999-02-19 01:00:00'
    '18' = '1998-06-19 18:00:00'
    '19' = '1999-03-05 01:00:00'
    '20' = '1999-03-12 01:00:00'
    '21' = '1999-03-19 01:00:00'
    '22' = '1999-03-26 01:00:00'
    '23' = '1999-04-02 01:00:00'
    '24' = '1999-04-09 01:00:00'
    '25' = '1999-04-16 01:00:00'
    '26' = '1999-04-23 01:00:00'
}

# Get all MKV files in the current directory
$files = Get-ChildItem -Path . -Filter '*.mkv'

# Loop through each file and update the timestamps
foreach ($file in $files) {
    # Extract episode number from filename
    if ($file.Name -match '1x(\d{2})') {
        $episodeNumber = $matches[1]

        # Get the corresponding air date
        if ($episodeDates.ContainsKey($episodeNumber)) {
            $airDate = $episodeDates[$episodeNumber]

            # Parse the air date to a DateTime object
            $dateTime = [datetime]::ParseExact($airDate, 'yyyy-MM-dd HH:mm:ss', $null)

            # Set the creation and last modified times
            $file.CreationTime = $dateTime
            $file.LastWriteTime = $dateTime

            Write-Host "Updated '$($file.Name)' to air date $airDate"
        } else {
            Write-Host "No air date found for episode $episodeNumber in '$($file.Name)'"
        }
    } else {
        Write-Host "Episode number not found in '$($file.Name)'"
    }
}