Manipulating “date added” in the Plex Media Server Database

So I noticed a quite annoying thing in my Plex Server, some items were always marked as “recently added”. As usual, I went online and searched for a solution.

Some posts suggested to wipe the library and start over, while some posts suggested that doing that doesn’t fix the problem as the “bug” seems to be that when an initial scan is done, some times Plex will add a “date in the future” as the “added date”.

So I got curious, I started looking at the XML-file of the Items in question, and just as described in one of the posts, the year of the added-date, was in 2037 a fair bit into the future.

I started looking for solutions to the problem and trying to find someone who had been able to fix it, when I stumbled upon a reddit post with a SQL-script.

Reddit Post by bauerknight

So I started by downloading the Plex SQLite3 Databases from my Plex Server (making sure to make backups of the original files…), I then downloaded a SQLite3 Database Tool to my computer and started exploring the database structure.

After looking around, it seemed like the 4 year old Script found on Reddit would do what I wanted, so I modified it to work on my Library and ran it.

After that I uploaded the DB-files to my Plex Media Server and started it, problem solved!

Reddit article: bauerknights post

SQL Oneliner for future use:

UPDATE metadata_items SET added_at = originally_available_at where library_section_id = '5' and added_at >= '2020-08-29 00:00:00'

You may also like...