duplicates¶
Operations for launching asynchronous duplicate searches across five comparison methods, resolving duplicate groups with metadata merging and safety rechecks and managing persistent ignore lists. All operations target a library.
duplicates.find¶
Start a background duplicate-detection job (canceling any duplicate scan already running on this library). Subscribe to job.finished or poll job.get to read the discovered groups once complete.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ways |
string[] |
No | ["content"] |
Comparison modes: content (exact BLAKE3 bytes), looks (perceptual thumbnails), video (6 sampled frames), sound (first minute audio fingerprint), archive (ZIP/CBZ/EPUB/7z entry CRC-32s). |
thresholds |
Record<string, number> |
No | { looks: 0.9, video: 0.9, sound: 0.7, archive: 0.9 } |
Per-mode similarity thresholds (0.0–1.0). |
lookKinds |
string[] |
No | All except video/audio |
Item kinds compared by looks. |
folder |
number |
No | — | Limit scope to a folder and its subfolders. |
ids |
(string \| number)[] |
No | — | Limit scope to specific items. |
query |
string |
No | — | Limit scope to items matching this query. |
withLibrary |
boolean |
No | false |
Compare scoped items against the entire library instead of only against each other. |
minSize |
number |
No | 0 |
Skip files smaller than this many bytes. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { job: string }. Once finished, Job.result holds the duplicate groups and omitted counts.
Example request
Example response
Events and errors Emits job.started, job.progress and job.finished. Returns 400 bad_request for invalid ways, out-of-range thresholds, invalid lookKinds, invalid query syntax or withLibrary: true without a scope, 403 not_allowed without metadata.read, 404 not_found for an unknown folder or item ID, 404 unknown_library, 409 library_closed / library_offline or 422 failed if starting the scan fails.
duplicates.resolve¶
Keep one item in each duplicate group and move the remaining copies to Trash after re-verifying that the kept file still exists and any identical copies still match byte-for-byte.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
groups |
{ keep: string \| number; remove: (string \| number)[]; identical?: (string \| number)[] }[] |
Yes | — | Up to 1000 groups to resolve. IDs in identical are byte-rechecked against keep before trashing. |
combine |
boolean |
No | true |
Merge tags, folders, highest rating, notes, source URL and empty user custom fields from removed copies onto keep. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { removed: number; kept: number; skipped: { id: string; reason: string }[] }:
removed(number): Total duplicate copies moved to Trash.kept(number): Number of groups resolved.skipped({ id: string; reason: string }[]): Items or groups left untouched by safety rechecks (for example when the kept file is missing or anidenticalcopy no longer matches byte-for-byte), with each item's UUID and reason.
Example request
Example response
Events and errors Emits items.changed (on kept items) and items.removed (purged: false). Returns 400 bad_request if more than 1,000 groups are given, 403 not_allowed without metadata.write, 404 not_found for an unknown item ID, 404 unknown_library or 409 library_closed / library_offline.
duplicates.ignore¶
Permanently mark all pairs among two or more items as not duplicates so future duplicates.find runs never group them together again.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
Yes | — | At least two item IDs. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { pairs: number } — number of ignored pairs recorded.
Example request
Example response
Events and errors Persists ignore pairs in SQLite. Returns 400 bad_request if fewer than 2 items are given, 403 not_allowed without metadata.write, 404 not_found for an unknown item ID, 404 unknown_library or 409 library_closed / library_offline.
duplicates.unignore¶
Remove persistent duplicate-ignore marks for specific items, or clear all ignore marks in the library when ids is omitted.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
No | (all ignored pairs) | Clear marks involving these item IDs. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { pairs: number } — number of ignored pairs removed.
Example request
Example response
Events and errors Clears matching rows from the duplicate ignore table. Returns 403 not_allowed without metadata.write, 404 not_found for an unknown item ID, 404 unknown_library or 409 library_closed / library_offline.