Skip to content

Instantly share code, notes, and snippets.

@pearsonc
Last active December 3, 2025 11:44
Show Gist options
  • Select an option

  • Save pearsonc/73a040a0ea188bb8b35db03079fecb70 to your computer and use it in GitHub Desktop.

Select an option

Save pearsonc/73a040a0ea188bb8b35db03079fecb70 to your computer and use it in GitHub Desktop.
Fix Plex Recently Added
#/bin/bash
sudo systemctl stop plexmediaserver
sudo /usr/lib/plexmediaserver/Plex\ SQLite "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db" "UPDATE metadata_items SET added_at = strftime('%s', 'now', '-1 year') WHERE added_at > strftime('%s', 'now');"
sudo systemctl start plexmediaserver
@pearsonc
Copy link
Author

pearsonc commented Dec 3, 2025

Previously added movies or shows keep appearing as "Recently Added" even after a library scan.

A glitch can occur when adding media to your library, in which the system sets a ridiculous future date in the item's metadata.

This script will update the added date for all shows, films, etc. that have a value greater than the system time (e.g., a future time) to exactly 1 year ago, effectively removing them from the recently added sections of Plex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment