2025-07-11, 07:00 PM
(2025-05-30, 08:22 PM)koenlol Wrote: This was bothering me too. I found a solution that has been working well for me, and I figured I'd post it in case someone comes across this thread looking for an answer like I did.
I configured Jellyfin to use file creation date in the 'Date added behavior for new content' setting. Then, I set up a custom script that:
I'll share the script I've been using, but be warned, it's AI-generated: https://pastebin.com/jem4Yf6B
- On 'Grab' looks for existing versions of the media in the library folders. If found, it extracts the file's creation date and saves it to a temporary file.
- On 'Import'/'Upgrade' changes the newly imported file's creation date to match the original, and deletes the temporary file.
- Triggers a Jellyfin library rescan after importing if an API key is provided.
You'll need to change the variables at the top of the script. After that, set it to run on 'Grab' and 'Upgrade' events in Radarr/Sonarr (Settings > Connect > Custom Script).
It's been working well on my server (ubuntu), but I don't know how it will work in other environments. I think the way your folder structure and naming schemes are set up is important. A log file should be created next to the script that might help with trouble-shooting.
I think I've found a way to make this work easier. If you enable the .nfo saver for the library, Jellyfin will save all of the metadata alongside the media file. Then for 'Date added behavior for new content', select 'Use date scanned into library'.
It will then use the created date of the .nfo file, which will persist across upgrades.