Changing a previously played episode/show/movie to unplayed deletes the data from dashboard watch history

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.

1 Like