Fixing plex media server added at
Several episodes on my plex server have always been hanging at the front of added at for a few months now. I’ve googled it a few times and changing the modified date in the filesystem wouldn’t bump it from the added list.
Turns out that plex uses the added date from the filesystem, but then stores it in the metadata, never to be refreshed. Turns out a little python script will fix that.
This code will update all added at dates from the future to something older.
import os, sys, datetime
from plexapi.server import PlexServer
token = "" # get from your plex server
plex = PlexServer('http://localhost:32400', token)
updates = {"addedAt.value": "2020-08-21 11:00:00"}
for s in plex.library.section('TV Shows').all():
for v in s.episodes():
if v.addedAt.year > datetime.date.today().year:
print('%s %s' %(v, v.addedAt))
v.edit(**updates)
Leave a comment