mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
fix(sqlite): filter out NULL phash values in FindDuplicates
This commit is contained in:
parent
18be6a7607
commit
765a6f6fc4
1 changed files with 4 additions and 2 deletions
|
|
@ -1437,13 +1437,15 @@ func (qb *SceneStore) FindDuplicates(ctx context.Context, distance int, duration
|
|||
finalQuery := `
|
||||
SELECT GROUP_CONCAT(DISTINCT scene_id) as ids
|
||||
FROM (` + sqlStr + `)
|
||||
WHERE durationDiff <= ?
|
||||
OR ? < 0
|
||||
WHERE phash IS NOT NULL
|
||||
AND (durationDiff <= ?
|
||||
OR ? < 0)
|
||||
GROUP BY phash
|
||||
HAVING COUNT(phash) > 1
|
||||
AND COUNT(DISTINCT scene_id) > 1
|
||||
ORDER BY SUM(file_size) DESC;
|
||||
`
|
||||
|
||||
var ids []string
|
||||
args := append(query.allArgs(), durationDiff, durationDiff)
|
||||
if err := dbWrapper.Select(ctx, &ids, finalQuery, args...); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue