Skip to content

Commit 41ae7cb

Browse files
committed
fix: update image duplicate checker UI and API handling
- Fixes 400 error in ImageDuplicateChecker - Updates UI and frontend types - Fixes tools casing
1 parent df8c025 commit 41ae7cb

3 files changed

Lines changed: 591 additions & 212 deletions

File tree

pkg/sqlite/image.go

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,13 +1105,29 @@ func (qb *ImageStore) FindDuplicates(ctx context.Context, distance int) ([][]*mo
11051105

11061106
var hashes []*utils.Phash
11071107
if err := imageRepository.queryFunc(ctx, query, nil, false, func(rows *sqlx.Rows) error {
1108+
var sq struct {
1109+
ID int `db:"id"`
1110+
Phash *string `db:"phash"`
1111+
}
1112+
if err := rows.StructScan(&sq); err != nil {
1113+
return err
1114+
}
1115+
1116+
if sq.Phash == nil {
1117+
return nil
1118+
}
1119+
1120+
hashInt, err := utils.StringToPhash(*sq.Phash)
1121+
if err != nil {
1122+
return nil
1123+
}
1124+
11081125
phash := utils.Phash{
1126+
ID: sq.ID,
1127+
Hash: hashInt,
11091128
Bucket: -1,
11101129
Duration: -1,
11111130
}
1112-
if err := rows.StructScan(&phash); err != nil {
1113-
return err
1114-
}
11151131

11161132
hashes = append(hashes, &phash)
11171133
return nil

0 commit comments

Comments
 (0)