I bookmarked several forum posts before the Forum updates, and one in particular I can access, but it is either missing the content I require for Windows or Plex updates have since removed the capability.
I want to update the PLEX database for the Recently Added to correspond to the Windows Date added or Date modified (added preferred). There was a post by users sfnetwork and losangeles that were able to perform this using SQLITE3 at the link below;
I also when I first found this was able to perform on my Windows machine. I am setting up a new PLEX system and would like to perform this task again. However the screenshot sfnetwork used is missing, and I am not able to get the commands losangeles provided to work on my system. I also cannot PM anyone, so I can’t inquire directly.
Additional info;
Windows 10
PLEX Version 0.9.14.6
Anything else, please let me know.
astrofisher; While I thank you for that info, the problem exists with the link I posted due to the image used in that discussion is no longer available and that contained the lines of code I needed.
I was able to figure it out for any of those who are interested in updating your plex database for Date Added based on the file’s creation date, not when it was loaded into your plex DB using a Windows (7-10) based system;
I attempted to use the same commands on the Mac. I was able to get to the sqlite prompts and load the database but the command listed about did not seem to work. Does anyone else have some ideas on how to implement this on the Mac? Would rebuilding the database also accomplish the same thing?
Thank you so much MI95SHO! I just moved around my folders and everything went out of whack. This fixed the sort to how it looked before I started messing with the folders.
Make sure you run the command on the “com.plexapp.plugins.library.db” file. The “metadata_items” table does exist in there.
Here’s a great open source application to view the SQL database in a more user friendly way: https://sqlitebrowser.org/
Just open the database file with the above application (be sure to close down Plex Media Server first) and click on the Execute SQL tab, then enter in: update metadata_items set added_at=(select media_items.updated_at from media_items where media_items.metadata_item_id=metadata_items.id);
Now click the play button to run it. It should only take a moment and then you’re all done.
Just FYI, the path to the database file on Mac OS is:
“/Users/NAME/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db”
I personally found that the recommended code above didn’t help my situation. After looking at the database, I noticed that the created_at field in the media_items table was in exactly the order I wanted. A small change to the command and my Recently Added looks perfect! Try this if the above code doesn’t work for you;
update metadata_items set added_at=(select media_items.created_at from media_items where media_items.metadata_item_id=metadata_items.id);
I thought I had this working, after upgrading to Version 1.14.0.5470 and re-running the commands as above, I’m still seeing some files “as recently” but WINDOWS shows otherwise (yes I did manipulate the data fields - created, modified, last accessed) with a 3rd party Windows plug in.