I prefer my home screen not showing old content as recently added. To avoid this, I update the db directly. I forgot to back up my queries the last time I formatted my main pc but I remember changes being made to the db that prevents updates to it unless indexes are dropped - anyone aware of which indexes?
Also if there is something that is preferred (like some app), that would be great too. Not a huge fan of having to do it manually but not a big deal either.
You only need to do that if you use the official SQLite command line tool. Plex has included this automatically with PMS. You can see examples of using this as part of our repair database article. Just change the command to use an SQL statement instead. Repair a Corrupted Database | Plex Support
To clarify, I prefer older movies to not show up in recently added even if I did recently add them. I update the date manually in the db to fix this issue. Ideally this would just be an option in Plex
As for using what Plex has provided, I can but I find it far easier / cleaner to do this via a Gui. Easier to confirm what I’m doing and unlikely to make a mistake. I’ll give it a try though.
@andy_d0
What you’re seeing might be related to this issue, but just for fun here’s what I use modify dates on Windows:
PowerShell:
& "${env:ProgramFiles(x86)}\Plex\Plex Media Server\Plex SQLite.exe" "${env:LOCALAPPDATA}\Plex Media Server\Plug-in Support\Databases\com.plexapp.plugins.library.db" "UPDATE metadata_items SET added_at = '2019-07-30 13:18:37' WHERE id = 210036;"
Well, my issue is that I know if I update the database directly without dropping some indexes that the edits will not be saved.
Otherwise, I think Plex is handling it how it is intended - old movies showing up as recently added…I just prefer it not to do that.
But thank you, that helps as well. I actually have queries saved that does this already - just that I’m missing what indexes I need to drop. This is what I would execute in a gui app…
update metadata_items
set added_at = originally_available_at
where library_section_id = 3
and added_at > '2020-05-01'
and originally_available_at < '2015-01-01';
Ever since Plex changed the SQLite database structure what seems to be over a year ago now, I found it’s easiest to simply use their built-in SQLite tool. Using that removes the need to edit/drop indexes compared to when using an external SQLite tool.
My typical flow is:
stop Plex Server
run queries I want (using Plex’s SQLite editor)
start Plex Server
Query results are auto-committed so voila, all done. No messing with indexes/constraints or having transactions roll back.