Comments (11)
The table has a unique constraint
which prevents duplicates.
I think what's happening is , with Plex's Cloud-based watch history, this feature is colliding with it.
In this case, there are 13 references to the series but the series was matched using a different Agent so it shows up as negative (not found).
When importing, I don't know what the PMS settings are for the Agents.
My recommendation to you is either use Cloud-based history tracking or DB-based. You can't use both
I'm considering removing this feature.
from plexdbrepair.
The table has a
unique constraint
which prevents duplicates.I think what's happening is , with Plex's Cloud-based watch history, this feature is colliding with it.
In this case, there are 13 references to the series but the series was matched using a different Agent so it shows up as negative (not found).
When importing, I don't know what the PMS settings are for the Agents.
My recommendation to you is either use Cloud-based history tracking or DB-based. You can't use both
I'm considering removing this feature.
Thank you for the answer. However it's not exactly what's happening since:
- I wouldn't need to import my Plex History if the cloud based tracking was enabled. It isn't in my case, it's fully locally on my database
- When I mark all episodes as "unwatched" the counter goes back to 0. It only turns negative when it's watched by myself on the old database and marked as watched on the 2nd database. And then merged of course.
i'm digging around in the db to see if I can find anything useful but as you are clearly a pro at this, any input and help is very much appreciated!
from plexdbrepair.
When I mark all episodes as "unwatched" the counter goes back to 0. It only turns negative when it's watched by myself on the old database and marked as watched on the 2nd database. And then merged of course.
If it turns negative when you watch it, independent of importing anything, stop right there.
Scenario:
- Mark unwatched
- Observe no negative counter
- Play normally / mark as watched manually
It only turns negative when it's watched by myself on the old database
- Observe negative count.
If this is what's happening then ALL STOP. That's a DB corruption deeper than what I can help with.
The only choice is to use a backup DB (full swap) from elsewhere.
My tool works on structure and whole tables. It doesn't have C++, agents, or metadata backing it like PMS does.
from plexdbrepair.
When I mark all episodes as "unwatched" the counter goes back to 0. It only turns negative when it's watched by myself on the old database and marked as watched on the 2nd database. And then merged of course.
If it turns negative when you watch it, independent of importing anything, stop right there.
Scenario:
1. Mark unwatched 2. Observe no negative counter 3. Play normally / mark as watched manually
It only turns negative when it's watched by myself on the old database
5. Observe negative count.
If this is what's happening then ALL STOP. That's a DB corruption deeper than what I can help with. The only choice is to use a backup DB (full swap) from elsewhere.
My tool works on structure and whole tables. It doesn't have C++, agents, or metadata backing it like PMS does.
So I found a potential answer for this issue:
I will test this out tomorrow on my database (of course with a backup) and if it works fine, I'll let you know. Then you can include the command in your tool! Will for sure help people
from plexdbrepair.
I have the same SQL from our devs.
"DELETE FROM metadata_item_settings
WHERE id in (SELECT MIN(id)
FROM metadata_item_settings
GROUP BY guid HAVING COUNT(guid) > 1);"
When this was tested, it didn't work in all cases.
Maybe it was those particular databases but also maybe not.
(I'm not the sharpest database guy)
If you look in DBRepair.sh , line #1274-1284, you'll see it's there but commented out.
You're welcome to experiment with it.
There might be a case where I ask to "Purge duplicates?" after importing because of Managed Users.
I'm open to ideas.
from plexdbrepair.
I have the same SQL from our devs.
"DELETE FROM metadata_item_settings WHERE id in (SELECT MIN(id) FROM metadata_item_settings GROUP BY guid HAVING COUNT(guid) > 1);"
When this was tested, it didn't work in all cases. Maybe it was those particular databases but also maybe not. (I'm not the sharpest database guy)
If you look in DBRepair.sh , line #1274-1284, you'll see it's there but commented out. You're welcome to experiment with it.
There might be a case where I ask to "Purge duplicates?" after importing because of Managed Users. I'm open to ideas.
Sadly I tried different things and the minus never disappeared. I'm now in contact with the writer of the article, but currently I have no news for you.. Sorry
from plexdbrepair.
You may have to purge the watch history where the count < 0.
Doing this has always been dangerous.
"DELETE FROM metadata_item_settings
WHERE id in (SELECT MIN(id)
FROM metadata_item_settings
GROUP BY guid HAVING COUNT(guid) < 0);"
You might have to purge ALL the current watch history and then import fresh.
from plexdbrepair.
I have fixed the issue with the minus counts. You can include it in your script and hopefully make some people happy. See the code below
DELETE FROM metadata_item_settings WHERE rowid NOT IN ( SELECT MIN(rowid) FROM metadata_item_settings GROUP BY guid, account_id );
Right now everything looks fine but when I see any problems I'll report back.
Credits would be lovely๐
from plexdbrepair.
Is this
DELETE FROM metadata_item_settings WHERE rowid NOT IN ( SELECT MIN(rowid) FROM metadata_item_settings GROUP BY guid, account_id );
a complete replacement for
"DELETE FROM metadata_item_settings
WHERE id in (SELECT MIN(id)
FROM metadata_item_settings
GROUP BY guid HAVING COUNT(guid) < 0);"
?
where the NOT IN is the key change ?
from plexdbrepair.
Is this
DELETE FROM metadata_item_settings WHERE rowid NOT IN ( SELECT MIN(rowid) FROM metadata_item_settings GROUP BY guid, account_id );
a complete replacement for
"DELETE FROM metadata_item_settings
WHERE id in (SELECT MIN(id)
FROM metadata_item_settings
GROUP BY guid HAVING COUNT(guid) < 0);"?
where the NOT IN is the key change ?
This command from me is a complete replacement, yes.
Not only the NOT IN, it's a complete rework as I search for matching guid and account_id and group them, then delete all but one entry
from plexdbrepair.
Included in v1.0.10
Thank you.
from plexdbrepair.
Related Issues (20)
- Custome Shares
- Would it be possible to support UnRaid? HOT 4
- How to restart from scratch the DB and import the view history from a backup HOT 2
- Windows support - Non Docker HOT 1
- New Prune feature uses the wrong folder. HOT 2
- Cannot write to databases folder HOT 8
- Best practice for IGNORE parameter? HOT 3
- macOS cache directory incorrect HOT 15
- Error: Unknown Host - unRAID Linuxserver Docker HOT 7
- Issue Detecting Plex installation latest Hotio Docker HOT 7
- Error 1 From Plex SQLite while importing HOT 5
- Update Readme instructions to use current release HOT 5
- Could Not Determine SQL Lite Path Error HOT 26
- Running `check` Command Too Soon After Stop Reports Damaged Database HOT 27
- TrueNAS SCALE - can't use script due to the healthcheck HOT 14
- Support PhotoTranscoder pruning on Windows
- Binhex , unable to stop from command line HOT 1
- Tried running from official docker image, yet it doesn't detect is as such HOT 1
- Support for Interactive/Scripted mode on Windows
- Question regarding watch history HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plexdbrepair.