mirror of
https://github.com/ChuckPa/PlexDBRepair.git
synced 2025-11-06 03:08:55 -05:00
Merge pull request #87 from ChuckPa/chuckpa/Prevent-Negative-Watch-Counts
DBRepair: Prevent negative watch counts
This commit is contained in:
commit
6307a9a5bf
@ -1297,9 +1297,8 @@ DoImport(){
|
||||
if [ $PurgeDuplicates -eq 1 ]; then
|
||||
cat <<EOF | "$PLEX_SQLITE" "$TMPDIR/$CPPL.db-IMPORT-$TimeStamp"
|
||||
DELETE FROM metadata_item_settings
|
||||
WHERE id in (SELECT MIN(id)
|
||||
FROM metadata_item_settings
|
||||
GROUP BY guid HAVING COUNT(guid) > 1);
|
||||
WHERE rowid NOT IN
|
||||
( SELECT MIN(rowid) FROM metadata_item_settings GROUP BY guid, account_id );
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user