I found a bug and here is a detailed description of it:
Bug Report: Incorrect “Recently Added” Sorting Due to File Modification Date
Summary
Plex uses the file’s LastWriteTime (Windows modification date) as the added_at timestamp in the database instead of generating its own timestamp when media is added. This causes media with incorrect file dates (e.g., future dates) to remain permanently at the top of “Recently Added” regardless of actual addition order.
Steps to Reproduce
-
Create a media file and set its modification date to a future date (e.g., 01/01/2098)
-
Add the file to a Plex library and run a library scan
-
Verify the file appears first in “Recently Added”
-
Add a new media file with a normal date and run another library scan
-
Observe the old file with the future date remains first in “Recently Added”
-
Query the database:
SELECT title, added_at FROM metadata_items– the old file’sadded_atcontains the future timestamp
AS IS (Current Behavior)
-
Plex directly copies the file’s
LastWriteTimeto themetadata_items.added_atfield -
The
added_attimestamp is never updated, even if the file’s modification date changes -
Media items sort based on file modification date, not actual library addition time
-
Media with future modification dates becomes permanently stuck at the top of “Recently Added”
TO BE (Expected Behavior)
-
Plex should generate a new
added_attimestamp based on the current system time when media is first added to the library -
The
added_atfield should be independent of the file’sLastWriteTime -
Media items should sort based on when they were added to Plex, not their file modification dates
Server Version#:1.42.2.10156
Player Version#:4.147.1
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>