mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
Sorting movies by recently added does not actually sort by most recently added #3085
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fuzxi on GitHub (Jun 13, 2021).
Describe the bug
Sorting by date added, as well as the "Latest Movies" section on the home page, does not sort by date added. If I run
ls -lt /data/media/moviesto list my movies folder by date, the three most recent movies are Splice, Super, and Antichrist. If I sort my movie library by date, the first four movies are Cool Hand Luke, Splice, Memento, and Super. Antichrist is somewhere in the middle of my collection. Cool Hand Luke and Memento have creation dates in 2020. Cool Hand Luke is about the 30th most recent movie, Memento is about the 20th most recent.Additionally, the Latest Movies section on the home page does not behave the same way. It shows none of these five movies. It instead shows an apparently random collection of somewhat recent movies which does not change when I add new movies.
This problem does not occur with my Series library which is hosted on the same remote mount; both the library view and Latest Series section are sorted as expected and identically.
Disabling external plugins and restarting did not have an effect on this issue.
System (please complete the following information):
To Reproduce
Expected behavior
Library should be sorted by most recently added.
Server Logs
log.txt
FFmpeg Logs
N/A
Browser Console Logs
N/A
Screenshots
N/A
Additional context
N/A
@michael9dk commented on GitHub (Jun 20, 2021):
Could the issue be the GetDate method here. It returns DateTime.MinValue for non-folders, that are used for comparison?
https://github.com/jellyfin/jellyfin/blob/master/Emby.Server.Implementations/Sorting/DateLastMediaAddedComparer.cs
@michael9dk commented on GitHub (Jun 20, 2021):
@fuzxi
Do you store the movies in subfolders inside /data/media/movies ?
@fuzxi commented on GitHub (Jun 21, 2021):
Yes. For example, Memento's path would be
/data/media/movies/Memento (2000)/Memento (2000) Remux-1080p.mkv.Same with series, they each have a subfolder for the show under
/data/media/series, and then another layer of subfolders for individual seasons.@martadinata666 commented on GitHub (Mar 18, 2022):
So when i think my sorted videos are weird, it seems jellyfin not recursively check video in folder.
Folder A created on 15 Feb and a Video added today, it still use Folder A created date as sort date, not the file added in.@PAHelper2 commented on GitHub (Apr 7, 2022):
FYI I've noticed this behavior forever also. I'm running 10.7.something on a Synology NAS, and I have no idea how "Date added" sort is actually figured out.
@hcgonzalezpr commented on GitHub (Oct 17, 2023):
I'm able to reproduce this behavior on Version: 10.8.11.
I did some research using the reports plugin, it seem importer is using file created date as the Date Added, instead of the actual date added to Jellyfin. This causes the recently added not to show as these files are dated in the past.
As a workaround I have added script to
touch "$item_path"the file to update its creation date.Edit: The proper way will be to change import settings on :
Dashboard -> Libraries -> Display -> Date added behavior for new content
@psaintmalo commented on GitHub (Nov 16, 2023):
Can reproduce in 10.8.12
Movie libraries when sorted by "Date Added" appear to be sorted (almost) by the release date of the media. While most are in release date order, there are quite a few ones that appear out of place.
For other libraries, sorting by "Date Added" will sort them by the date that the media was added to the library.
@jellyfin-bot commented on GitHub (Mar 16, 2024):
This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.
If you have any questions you can use one of several ways to contact us.
@jellyfin-bot commented on GitHub (Apr 6, 2024):
This issue was closed due to inactivity.
@martadinata666 commented on GitHub (Apr 6, 2024):
Please stop closing issue that unsolved or stale, due no response from developer.
@oddstr13 commented on GitHub (Apr 6, 2024):
@martadinata666 If you comment within 3 weeks after the first stalebot message, the four month stale timer get reset.
@jellyfin-bot commented on GitHub (Aug 5, 2024):
This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.
If you have any questions you can use one of several ways to contact us.
@martadinata666 commented on GitHub (Aug 5, 2024):
up
@patcfly commented on GitHub (Aug 9, 2024):
I am experiencing this bug - always have. I store media in their own directories under the movies dir. Additionally, I use mergerfs to present multiple volumes as a single volume to my docker services. Not that I think that matters.
What I experience is that after every pull and restart via compose up -d, the date added sort changes. Some of my most recently added files look like they were added first and some of my first added media appear like I just added them.
This is particularly annoying when using a service like jellyseer that lets users request media, it completes, and then it doesnt show up when browsing jellyfin as recently added content.
@barndawe commented on GitHub (Sep 15, 2024):
I'm having the same issue. The movie files are being put into named folders for each single movie and not appearing in the order they were added.
I'm experiencing this with newly added media, it often ends up at the end of the list when sorting but added date newest first.
This exact same setup works just fine on Plex.
@JkBoyo commented on GitHub (Oct 4, 2024):
So my instance seems to be working fine based on file creation date. Can you verify that your setting
is set to use file creation date or the date added to library?
It could be we just need to better let people know that this setting exists.
@barndawe commented on GitHub (Oct 4, 2024):
I've just tried changing it, including restarting the server afterwards. Both settings give me exactly the same list, and still not in order of when they were added. Currently running 10.9.11 via Docker on a Debian VM host
@patcfly commented on GitHub (Oct 4, 2024):
My setting matches yours:

@JkBoyo commented on GitHub (Oct 4, 2024):
interesting. I will have to do some playing around and see where the location of the data it's fetching is held. Bc it does look like in mine that they match this. Did you guys check using ls -lt on the dirs where you have it stored to compare those to the order presented by the lib like OP? And maybe instead of a server restart try a library scan update?
@barndawe commented on GitHub (Oct 5, 2024):
ls -lton my movie dir gives me the order I'd expect (and the order I get in Plex), not the order that Jellyfin is giving me. I tried library scan update as well,forgot to say. It made no difference sadly.@JkBoyo commented on GitHub (Oct 5, 2024):
Do the metadata dates on the individual pieces of content match the ordering? For example

This date on mine doesn't match the actual file creation date.
@JkBoyo commented on GitHub (Oct 5, 2024):
but the order is still the same.
I also have a slightly weird case bc I transferred my metadata between servers semi recently.
@barndawe commented on GitHub (Oct 5, 2024):
The 'date added' does match the ordering, and also matches the file created date ordering, but not the directories they are within. i.e. I have one file that claims it was created in 2007, but it was added a few months ago and the containing folder's creation date reflects that.

As you can see above I've got library added date for the date and forced both a library rescan and a metadata regen, no change.
@JkBoyo commented on GitHub (Oct 5, 2024):
So you think it is ordering things based on when the directory was created?
@barndawe commented on GitHub (Oct 5, 2024):
Ordering seems to be based on the 'file created date' even when 'use date scanned into the library' is selected for me, and the file created dates are wrong. It looks like Plex is using the date the folder containing the file was created (my library is like 'movies/movie name/movie name.mp4', for example) but Jellyfin is using file date even when it's told not to
@JkBoyo commented on GitHub (Oct 5, 2024):
So that setting seems to be how it adds the metadata field for new content not how it pulls it in during a library scan. Can you test to see if when set to
scan in dateit uses that for new content?@martadinata666 commented on GitHub (Oct 6, 2024):
No, settings will matter, it just jellyfin loves using "folder created" add instead of file added into the folder, this behavior is more seen when we collect many random videos.
In theory by "recently added"
yyy.mp4should be sorted first. But no, jellyfin will usewww.mp4as the first recently added. It doesn't matter the setting it just works that way.@JkBoyo commented on GitHub (Oct 6, 2024):
So @maradinata666 your comment is now contradicting @barndawe 's comment. I understand we have an issue here and I am trying to help prove it is something we can put our time to. To do that though I have to be able to fully understand and reproduce the issue. Are you positive it will always work the same way and ignore the aforementioned setting? Have you tested it?
@martadinata666 commented on GitHub (Oct 6, 2024):
Yes, I'm deleting,rescan, or change many sort settings, etc. It just don't get sorting "recently added" right, plex and emby done right. IMO Jellyfin use the
folder creation dateinstead of the file added in to the folder, that the file added may got different "creation date", "added date" or "bla bla date" that making jellyfin sort correctly. Maybe the most correct term will be "recently added" jellyfin did not use a flat directory structure, which most user expects. If the folder was created in 2023, we need to scroll down, find the folder, and click the folder, then the newly added video will show the most top left (right behavior inside the folder). Why? When I click my library just show my media that I added last time, I don't want to scroll to find my folder to access my newly added media. Let say jellyfin don't want use "flat directory" then the folder that created in 2023 should be shown most top left as a media added in it recently.@stefandxm commented on GitHub (Oct 16, 2024):
So that setting is a bit silly for default. Newly added should be new added not newly created on disk imho.
After changing the setting and making a re-scan, it is not automatically fixed. Can that be arranged? It wont even re-fix the manually touched files.
@cmck359 commented on GitHub (Feb 7, 2025):
I encountered this error while running version 10.10.5.
Upon inspecting the
library.db, it appears that when a new child item is added to an entity—for example, when a new episode is scanned during a library refresh—the parent entity (such as the TV series) does not have itsDateLastMediaAddedfield updated. From what I can tell the sort order matches theDateLastMediaAdded1:1.The
DateLastMediaAddedvalue is updated when performing a "Scan for missing metadata" refresh. However, it would be ideal if this also occurred during a "Scan for new and updated files" refresh.Also,
DateLastMediaAddeddoes not appear to be user-changeable, as it does not appear in the jellyfin web metadata editor.@death69inc commented on GitHub (Apr 8, 2025):
So what your saying is it needs to be fixed be the Dev team.
Trying to find suitable replacement for Plex but this issue drives me nutty.
I see many asking how to recreate this.... all you have to do is add a tv show episode and see it will not work shows last show you added not episode added.
But im on windows but seems people like to merge issues when they are slightly diffent issues.
@felix920506 commented on GitHub (Apr 8, 2025):
This is a user configurable setting.
Users with admin privileges on the Jellyfin server can change it at: Dashboard > Libraries > Display
@patcfly commented on GitHub (Apr 8, 2025):
I see it is admin configurable @felix920506 the problem was that it was not working as the UI lead us to believe. It is actually working as expected in 10.10.7 though. I don't know when it started working as expected but it was recent.
@felix920506 commented on GitHub (Apr 8, 2025):
If you have any suggestions please hop on our discord or matrix and talk about it in the ui/ux channel. https://jellyfin.org/contact