2024-10-07, 09:09 PM
(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)'"
}
}