In February, I tried out a DLNA client that is clearly poorly written. It somehow rapidly marked a ton of my movies (~140 movies) watched pretty much instantly. I think it did this by trying to generate thumbnails or something. Some were already watched prior to that, some were unwatched prior.
When realizing the issue at the time I rolled back the Plex database to a recent backup and also manually deleted the ~140 plays from my Plex profile Watch History.
I never really paid attention until looking through my library recently and kept finding that some movies I know I’ve never watched are marked as watched. I’m not sure what went wrong with my restoration attempts, but if I go to my Movie library and sort by Date Viewed, then I see the ~140 movies listed on that day 6 months ago. But if I click on one of those movies and click Play History, it does NOT actually have that day listed at all. It just either has no play history (despite saying Watched) or history from when I actually did watch it possibly years ago (and also has that on my Plex profile play history). Plex Dash, similarly, only shows actual play history for those items, not the February entry.
I suspect part of the issue is that I sync with Trakt (Plex-Trakt-Sync). And perhaps an automated sync was performed after the movies were marked watched by the DLNA client but before I restored the database. Yet, Trakt only shows 28 movies “watched” on that February date. Maybe only 28 of the 140 were actually unwatched at that point in time?
Anyway, wondering how I can go ahead and remove all database entries specifically from that date in February?
Adding some more details. I tried using Plex Sqlite…
The following SELECT * FROM metadata_item_views WHERE viewed_at >= 1707541200 AND viewed_at <= 1707627599; shows no results. Meaning indeed my previous removals of views persisted.
However the following: SELECT * FROM metadata_item_settings WHERE last_viewed_at >= 1707541200 AND last_viewed_at <= 1707627599; does indeed return a long list of results.
But now, comically, I don’t know what to do with that. Since it’s not entries for views (where I can just delete the entry) but rather a last_viewed_at time for each movie, I’m not sure how to revert to previous viewed time (or set to unviewed if not previously viewed).
I can definitely refine by last_viewed_at >= 1707541200 AND last_viewed_at <= 1707627599 because everything viewed on February 10 is impacted, so I don’t necessarily need to refine by GUID - should makes things easier.
I need to play with the database more, but I was under the impression the metadata_item_settings table only has one entry for each movie, whereas metadata_item_views has one entry for each view. So if I delete any row from metadata_item_settings won’t that totally delete the history of that item? Meaning something I watched in 2020 will still be marked unwatched if I delete the entry.
I know you’re more of an expert with the applications and installations than the database, should I cross-post to another subforum?