"Recently Played Episodes" show episodes played over a year in the future

Context / Logs

Server Version#: 1.19.2.2702 (776106bc6), but the problem may have first manifested in whatever was the latest beta version of PMS for Synology around 2020-02-19 to 2020-02-21…it might be

  • 1.18.7.2434 (db2335ec5)
  • 1.18.7.2438 (f342a5a43)

Player Version#: not applicable (as this is in a PMS db file): all players, including web, Android

Plex Media Server Logs_2020-04-24_11-00-19.zip (4.9 MB)

Summary

It looks like 4 episode watches got logged as having been watched “in the future”. I’m curious how I can correct this, so that my “Recently Played Episodes” list and my logs in general are accurate.

Detail

In the last handful of weeks, I noticed that the “Recently Played Episodes” tile that I added to my home screen always showed the following four episodes first (as having been the most recent) and that any new episode of any other show I watched would always come after those 4 episodes:

  • DC’s Legends of Tomorrow - s05e05 (actually watched 2020-02-21 12:51 PST)
  • The Flash (2014) - s06e12 (actually watched 2020-02-21 12:06 PST)
  • Supergirl - s05e12 (actually watched 2020-02-21 11:21 PST)
  • Batwoman - s01e12 (actually watched 2020-02-19 21:42 PST)

As of this posting, I have watched 190 episodes of shows since these above, but these always show as the most recently played.

Here’s how it appears in the Android app (you may see the clipped entry for the last episode I actually watched last night (an episode of Star Trek: The Next Generation), appearing after the entry for Batwoman I watched roughly 2 months ago):

While I did, in reality, watch these close to one another, I also watched two other episodes of shows between those episodes of Batwoman and Supergirl (His Dark Materials s01e06 and s01e07), and they are logged correctly. I’m imagining that it’s just a coincidence that these are Arrowverse shows…

I also happened to notice this when the Plex Dash app came out and actually gave more information about recently played episodes:

Okay…more investigation is required. I made a copy of /volume1/Plex/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/com.plexapp.plugins.library.db and ran some SQL commands on it (using sqlite3), dumping the output to a text file (Plex.View.Log.2020-04-24.txt):

SELECT c.name,
b.title,
a.rating,
a.view_count,
CASE
WHEN a.view_offset IS NULL THEN '100.0%'
ELSE printf('%.1f', 100.0 * cast(a.view_offset AS REAL) / cast(b.duration AS REAL)) || '%'
END percent,
a.last_viewed_at
FROM metadata_item_settings a
LEFT JOIN accounts c ON a.account_id = c.id
LEFT JOIN
(SELECT a.guid,
CASE a.library_section_id
WHEN 1 THEN a.title
WHEN 2 THEN d.title || ' - S' || substr('00' || c.`index`, -2, 2) || 'E' || substr('00' || a.`index`, -2, 2) || ' - ' || a.title
WHEN 6 THEN a.studio || ' - ' || a.title
END title,
b.duration
FROM metadata_items a
LEFT JOIN media_items b ON a.id = b.metadata_item_id
LEFT JOIN metadata_items c ON c.id = a.parent_id
LEFT JOIN metadata_items d ON d.id = c.parent_id
WHERE a.metadata_type = 1
OR a.metadata_type = 4) b ON a.guid = b.guid
WHERE b.title IS NOT NULL
AND a.last_viewed_at IS NOT NULL
ORDER BY a.last_viewed_at ASC;

Now, here is the relevant line of output from each of the following commands:

  • cat Plex.View.Log.2020-04-24.txt | grep Batwoman
    ArthurZey   Batwoman - S01E12 - Take Your Choice                3           100.0%      2021-07-08 17:32:05
    
  • cat Plex.View.Log.2020-04-24.txt | grep Supergirl
    ArthurZey   Supergirl - S05E12 - Back from the Fut              3           100.0%      2025-12-04 16:20:23
    
  • cat Plex.View.Log.2020-04-24.txt | grep Flash
    ArthurZey   The Flash (2014) - S06E12 - A Girl Nam              3           100.0%      2026-01-05 08:30:31
    
  • cat Plex.View.Log.2020-04-24.txt | grep Tomorrow
    ArthurZey   DC's Legends of Tomorrow - S05E05 - A               3           100.0%      2026-02-05 06:21:07
    
  • cat Plex.View.Log.2020-04-24.txt | grep Materials
    ArthurZey   His Dark Materials - S01E06 - The Daem              2           100.0%      2020-02-20 20:52:49
    ArthurZey   His Dark Materials - S01E07 - The Figh              2           100.0%      2020-02-20 21:43:57
    

So it looks like these four episode watches got logged in the future for some reason.

Here’s another view of reality versus log:

Show Episode Actually Watched Log
Batwoman s01e12 2020-02-19 21:42 2021-07-08 17:32:05
Supergirl s05e12 2020-02-21 11:21 2025-12-04 16:20:23
The Flash (2015) s06e12 2020-02-21 12:06 2026-01-05 08:30:31
DC’s Legends of Tomorrow s05e05 2020-02-21 12:51 2026-02-05 06:21:07

To my knowledge, there was nothing funky going on, time-wise or otherwise, with my Plex server around the time that I actually watched those episodes.

The only other thing I can think of is a hiccup in the Trakt.tv plugin (which is at version 1.3.2), since the way I have it configured is that when I manually log something in Trakt.tv (which I do for all episodes), it syncs down the watched status to Plex. (I always manually log in Trakt.tv, since I watch things outside of Plex sometimes…shocking, I know!)

At the end of the day, I need to figure out a safe way to adjust these entries…I’m a little reluctant to manually edit the com.plexapp.plugins.library.db file because my understanding of how the systems work is pretty limited, so I don’t know if changing the last_viewed_at field for those rows will simply resolve the problem or introduce even worse inconsistencies into my setup.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.