feat(backend): report stored pairwise distances in the duplicates response
ListVisible already loads each pair's Hamming distance, but clusterPairs threw
it away. Thread it through: Clusters now returns a Cluster carrying the stored
pairwise distances (indexed once per page), and the list endpoint emits them as
{a, b, distance}. Pairs linked only transitively have no stored distance and are
omitted. Lets the UI show how close each file is to the kept one without a
client-side hash compare (phash exceeds JS's safe-integer range).
This commit is contained in:
@@ -1956,6 +1956,28 @@ components:
|
||||
description: Two or more mutually similar files
|
||||
items:
|
||||
$ref: '#/components/schemas/File'
|
||||
distances:
|
||||
type: array
|
||||
description: >-
|
||||
Stored perceptual-hash (Hamming) distances between pairs of files in
|
||||
the cluster. A pair linked only transitively (through an intermediate
|
||||
file) has no stored distance and is omitted.
|
||||
items:
|
||||
$ref: '#/components/schemas/DuplicatePairDistance'
|
||||
|
||||
DuplicatePairDistance:
|
||||
type: object
|
||||
required: [a, b, distance]
|
||||
properties:
|
||||
a:
|
||||
type: string
|
||||
format: uuid
|
||||
b:
|
||||
type: string
|
||||
format: uuid
|
||||
distance:
|
||||
type: integer
|
||||
description: Hamming distance (0–64) between the two files' perceptual hashes
|
||||
|
||||
DuplicateClusterPage:
|
||||
type: object
|
||||
|
||||
Reference in New Issue
Block a user