I’ll try and keep this simple. Take this scenario:
You watched a TV Show at some point in the past, I’ll use The Book of Boba Fett as an example. You have a full play history for that show which displays both dashboard in the web app and the plex dash app.
Then you decide to watch the show again and set the show to unplayed.
What happens is all your historical play history for that show is deleted. Looking in the DB I can also confirm this. If you run this query while you have the data you can see their is 7 records for this view history for the show …
sqlite> select count(id) from metadata_item_views WHERE grandparent_title GLOB 'The Book of Boba Fett*';
count(id)
---------
7
now in the plex UI go and mark this show unplayed and then run the exact same query again …
sqlite> select count(id) from metadata_item_views WHERE grandparent_title GLOB 'The Book of Boba Fett*';
count(id)
---------
0
sqlite>
You can clearly see the count is now zero and all the historical view data is deleted. Checking in the dashboard and plexdash app confirms its also gone.
@anon18523487 hope its okay to tag you on this post as you have commented on similar issues in the past and might be able to help get attention on it.
I’ll post a workaround to this issue for anyone else who runs into this.
What I done was to export all the historical view data before changing the view status from played to unplayed. At a high level this is what I done…
Stop plex. Then export the historical view data using the following command…
"/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db ".output metadata_item_views.sql" ".dump metadata_item_views"
That will create a metadata_item_views.sql file with the exported data.
Start plex again and now change the played status to unplayed. At this point the data is deleted from the db. Stop plex again. Now delete the existing historical data and re import it again from the export earlier:
"/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db
delete from metadata_item_views;
.quit
"/usr/lib/plexmediaserver/Plex Media Server" --sqlite com.plexapp.plugins.library.db ".read metadata_item_views.sql"
Start plex again and the historical data is back with the played status adjusted to how you want it.
Hopefully someone from plex will eventually fix this bug as its pretty bad and the workaround is a bit involved for most folks.
@OttoKerner as an fyi… I tested a show which has played history for multiple users and can confirm that ONLY the user data for the user changing status is deleted. The other users play history remains. So that’s something at least.
Dear Otto, thank you for filing the report.
I preparation of the One-Year Anniverary of that bug - would you please be so kind to investigate on what distracts developers from fixing it? I mean, no pun intended … I know that devs always have more bugs to fix than they can - all the times. But since the workaround is not something easily done by average users, I would call it severe (since it deletes metadata). Maybe your investigation could spur some renewed attention to this problem.
Ultimately this is data loss. Your previously watched data is deleted unknowingly to the user. This is not some misaligned button in the UI or something that does not look right. Your data is GONE and needs to be manually restored.
Plex should have rushed to fix this type of data loss but their priorties are elsewhere …
13 months and still a bug. Today, finished re watching Star Trek Deep Space Nine and changed Star Trek Voyager from played to un played and you guested it, plex deleted ALL MY previously watched/played records for the show.