DBRepair development

IMHO, no, since it’s not a repair operation, but a by design from Plex

@dane22

Thanks. Excellent point. That settles it. It’ll stay freestanding.

Sounds great Chuck :grinning_face:

Was just looking to clean this up myself so great timing… and agree with others that stand alone makes sense. Thanks!!

@Insomnic_1

May I send you something to read and investigate ?

I agree. A few entries in the database is not going to impact normal performace – not a high priority. Nonetheless, I think this would be useful as stand-alone function (ie. not part of more routine repair activity.)

I’m curious to check my database for records like this. I’m not familar with the schema and it would take a bit of time to work out the SQL to check my database. If the awesome ChuckPa adds this kind of function to DBRepair perhaps it could check the database and flag/indicate there are records that can be discarded/removed.

I think I’ve granted access to roughly 320 Plex Buddies over many years. (Of course, the maximum 100 Plex Buddies can have remote access at any time). I’d guess there will be a few user entries in my database that could be safely discarded.

I’d personally be interested in a “purge all play history” option. Surrounded with scary messages and warnings, and maybe double or triple confirmation. Basically, if selected, reset the database as though nothing has ever been played/watched from the local server.

The reason being that I sometimes just like to pretend it’s brand new. Get that new car (PMS) smell.

I used to be able to do the by marking things unwatched in Plex Web. That functionality was removed a couple of years ago; toggling watched/uneatched no longer does this.

The only way to do this now is manually remove play history via Plex Dash, or script your own database cleanup solution.

So this a feature request: Provide an option to clear/clean all play history for all libraries, with appropriate scary messages.

I realize I’m using both watched/unwatched and play history above. That’s intentional. Plex treats those things differently. So play history is distinct from watched status.

I’d like a convenient way to clear play history; Plex already provides a convenient way to clear watched status.

I don’t want to sound negative, I’m just curious, but in this case wouldn’t it just be better to just straight up delete the database and start fresh?

Above would req. rescanning of medias, intro detection, credit detection, voice analyze, chapter pics etc..
Above is a huge task

Also without been negative, but really fail to see others wanting this, but could be wrong

One question:

Is it safe to run the Windows PowerShell script (DBRepair-Windows.ps1) with the PMS 1.43.4.* branch?

Thinking about those malformed JSON messages.

I’d say backup and try it but DO a backup. If you run into this you end up with an unusable database as the import fails.

I do have some more testing to do but I think I might have fixed it on my side and I’ll update here (and the other thread) once I know more.

Thanks!

Think I’ll wait :grinning_face:

I seem to have fixed malformed JSON problem by doing a full forced refresh of metadata against all my libraries and then doing an optimise on the db. My guess is something changed in the schema with version 1.43.4.10903 which plex did not like until it was updated/refreshed. Anyhow, it appears to be okay now but I’ll continue to monitor.

@chuckpa Sure. I’ll give it a shot.

No, because that would throw out everything. Ad detection, intro detection, credit detection, media analysis, sonic analysis, etc.

I’m specifically just looking for play history nuking. I understand it’s niche, but… I’d like it.

I don’t share my server and don’t care about play history. I’d just like a convenient way to prune it. It consumes a non-negligible amount of DB space.

I complained when Plex changed the watched/unwatched toggle from removing play history, but it fell on deaf ears.

Try and run the following SQL on the database, and remember to make a backup first

DELETE FROM "metadata_item_views";
UPDATE SQLITE_SEQUENCE SET seq = 0 WHERE name = "metadata_item_views";
VACUUM;

@dane22

That’s a complete clearing of metadata_item_views and reset of the counters ??

Correct, and what @pshanew wanted, or?

Changes project name

DBRepair by @dane22

:rofl:

As I said to @pshanew most likely not for DBRepair, since I doubt others would want it, thus why I simply gave the SQL statements