mirror of
https://github.com/ChuckPa/PlexDBRepair.git
synced 2025-11-06 11:18:54 -05:00
DBRepair: Prevent negative watch counts
Changes grouping and deletion. Thanks @tkkg1994
This commit is contained in:
parent
2d93f36ad9
commit
91959549ac
@ -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