Repository navigation
feat(libraries): let admins mark unmatched items as intentionally unmatched - #2438
Conversation
…atched
Some media has no provider match and never will, such as a disc special a
provider no longer lists. It stays on the admin Unmatched list for good,
and the only suppression that existed, media_files.match_suppressed_at,
is cleared by every scan.
A new media_items.match_ignored_at marks a provisional movie or series as
intentionally unmatched. Ignored items leave the unmatched list and its
total (v1 shares the query), and listUnmatchedItems lists only them with
ignored=true, carrying ignored_at. Automatic matching leaves them alone:
MetadataService.Process pins them like an unmatched split target in every
mode but Identify, the movie and series matcher queues skip and drain their
files, the scan retry and library refreshes leave them out, an item refresh
is a completed no-op and a season or episode refresh stops before a
provider search. The item upsert, and an admin edit that sets the status,
clear the mark once the item is matched.
PUT and DELETE /api/v2/libraries/unmatched-items/{content_id}/ignore set
and clear the mark, re-evaluating the item's matcher queue rows, and the
library capabilities document advertises ignore_unmatched. Books keep
their own enrichment and cannot be ignored. The merged Silo-Server#2413
breaking-change approvals are dropped now that they match no change.
Each movie or series row in Unmatched Items gets an Ignore button next to Match, and its toast offers Undo. A view picker beside the search switches to the ignored items, where Restore puts one back. The header counts the items awaiting a match, and the section stays visible while anything is ignored, so an admin who ignores every item can still find them.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
The media route manifest lists every v2 route, so it gains the PUT and DELETE ignore routes. The ignored cursor filter formats its value with strconv instead of repeating a "true" literal, which goconst flagged.
Ignoring or restoring an item re-evaluated every one of its files against the movie queue and every root against the series queue, so a series with many episodes ran a transaction per episode that could never change anything. The item's type now picks the queue: a movie's files go through the movie queue and a series' roots through the series queue.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
…itch goconst flagged the movie and series literals; itemTypeMovie and itemTypeSeries already name them.
…ibility The requeue chose the queue by the item's type, but the movie and series queues decide by library type, and in a mixed library by the file's base type. An item whose type disagreed with its library reached only the queue that rejects its files. Each file now goes to the queue whose predicate it can meet, still once per movie file or series root.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Quick104
left a comment
There was a problem hiding this comment.
Review of c53c1c1: four findings. I'm fixing three of them in commits on this branch. The Root Override one needs your call. Once the fixes are pushed I'll post a summary comment with the scores.
Reviewed with Claude Code (claude-opus-5-5), cross-checked by Codex (gpt-6.1-sol).
| return false, nil | ||
| } | ||
| if pinned, err := w.service.pinnedUnmatchedBySplit(ctx, skeleton.ContentID); err != nil || pinned { | ||
| if pinned, err := w.service.pinnedUnmatched(ctx, skeleton.ContentID); err != nil || pinned { |
There was a problem hiding this comment.
Needs your call. A Root Override set on an ignored item is saved but never applied. applyQueuedGroupOverride now returns early for any pinned item. The queue predicates also drop the ignored item's files, even for a requested rerun, so no queue row forms. SetRootOverride answers 204 without clearing the mark or requeuing anything. Take an admin who learns the TMDB ID later and sets forced_tmdb_id instead of using Match Item: nothing happens, and the item stays in the Ignored view.
Options:
- (a)
SetRootOverrideclears the mark on provisional items under that root, so a forced ID works like Match Item. - (b) Reject the override with 409 while the item is ignored.
- (c) Keep this behavior, and document that a forced identity on an ignored item needs Restore first.
Unmatched split targets already skip group overrides, so (c) matches what Silo does today. I'm not changing this.
There was a problem hiding this comment.
Going with (c): an override on an ignored item applies once the item is restored, the same way a split target already treats overrides, and Match Item stays the direct route. #2500 documents it in the libraries API doc and the media-naming override rules.
…s skipped An item refresh of an ignored or split-pinned item now returns without searching providers, but it also left the item's refresh-debt row untouched. A scheduled refresh had claimed that row, and nothing cleared the lease or moved next_refresh_at, so the row was claimed again every lease period. The pinned path now syncs the row the way a successful refresh does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tored Partial splits let two provisional items share one observed root. Ignoring one keeps the root's queue row for the other, and a restore's EnqueueSeriesRoot left a parked row parked, because the root's input fingerprint does not change with the mark. A restore now returns the row to pending, without a rerun of files that are already matched. The ignore and restore updates also write only when the mark changes, so a repeated request, or a restore of an item that was never ignored, leaves the matcher queues alone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A season or episode refresh of an ignored series stops before any provider search and counts as a failed attempt; only an item refresh completes without changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-items # Conflicts: # scripts/ci/db-contracts.txt
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Evidence is incomplete for the changed unmatched-items workflow: the description identifies desktop/phone captures and manual testing, but not a recording of Ignore → Ignored view → Restore/Undo. Please include a short recording of that flow; the evidence page should also show the before-and-after desktop and mobile admin screens with the same data. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
Review summaryReviewed head: Fit: 8/10 · Readiness: 8/10 — conditional All 21 checks pass on Addressed
Each fix has a DB test. Against PostgreSQL 18 with pgvector, the new assertions fail on Remaining
Validated featuresNo recorded-passed case is affected. The unmatched-items criteria in #198 and #1251 C1 have no results yet, so the Docs, apps and jellycompat
Scores
Reviewed with Claude Code (claude-opus-5-5), plus a cross-check by Codex (gpt-6.1-sol) that found the shared-root issue. |
Problem
Closes #2392
Related issue: N/A
Validation tasks: none (the unmatched-items criteria in #198 and #1251 C1 have no recorded results yet; the Unmatched Items section gains Ignore, Restore and an Ignored view, and Match is unchanged)
Some media will never match a provider: a disc special a provider has since dropped, a home video, a local recording. Today it stays on the admin Unmatched Items list for good. The matcher keeps retrying it, and every scan counts it as still unmatched. Admins who alert on the unmatched count can never get it to zero, and taking the provider ID out of the file name doesn't help, because the next scan lists the item again. This PR lets an admin mark a movie or series as intentionally unmatched, from the list or the API, and undo that later.
The only suppression that exists today,
media_files.match_suppressed_at, is the matcher backlog's Cancel action, and every scan clears it. A title-only.nfonext to the file does work now (the item becomesmatchedunder itslocal-ID), but it needs write access to the media folder and a file for each item.Approach
The mark is a nullable
media_items.match_ignored_attimestamp. The item keeps itsunmatched,pendingorambiguousstatus, so there's no new status value for the apps to decode.While the mark is set:
GET /api/v2/libraries/unmatched-itemsand itstotalleave the item out.?ignored=truelists only ignored items, each withignored_at. The frozen v1 route shares the query, so it hides them too; its response shape doesn't change.MetadataService.Processpins it the same way it already pins an unmatched split target, in every mode except Identify. The movie and series matcher queues skip and drain its files, so it also leaves the Metadata Matcher backlog, parked rows included. The scan retry and library refreshes skip it, so scans stop reporting it as still unmatched. An item refresh completes without doing anything, and a season or episode refresh stops before it searches a provider.Match Item still works on an ignored item, and a successful match clears the mark (in the item upsert, and when an admin edit sets the status to matched). Clearing the mark puts the item back on the list and queues its files for matching again.
PUTandDELETE /api/v2/libraries/unmatched-items/{content_id}/ignore(ignoreUnmatchedItem,unignoreUnmatchedItem) set and clear the mark. They are admin only, answer204, and repeating either changes nothing. Ignoring a matched item or a book answers409. Books are left out on purpose: they are beta, and their enrichment paths setmatcheddirectly.getLibraryCapabilitiesreportsignore_unmatched: true, anddocs/libraries-api.mddescribes the operations.In the web admin, each movie or series row in Unmatched Items gets an Ignore button next to Match, and its toast has Undo. A picker beside the search switches between "Awaiting a match" and "Ignored", and the Ignored view has a Restore button. The header always counts the items awaiting a match. The section stays visible while anything is ignored, so an admin who ignores every item can still get to them.
An item refresh used to count a pinned result as a failure. It now treats it as done, which also applies to split targets;
ProcessResult.Pinnedwas already documented as "a completed outcome, not a failure".This is admin only. The Apple and Android apps have no unmatched list, so they need no follow-up, and jellycompat has nothing equivalent. The user manual update is tracked in Silo-Server/siloserver.org#204. Hiding a file completely, suggested in the issue, is already covered by
.ignorefiles (#1314), so it isn't part of this.Validation
Tested commit:
ab291a52f. Four follow-ups came after it.df16f9076only adds the two routes to the route manifest test data and fixes a lint finding in the cursor filter.11b420e08andc53c1c156requeue only the queue a file can join, chosen by library type the way the queues choose, so a series no longer runs a movie-queue transaction per episode; the handler DB test passes on both and now covers a series too.9ae8daa0fswaps two string literals for existing constants to satisfy lint.internal/apiv2package and name-filtered runs ininternal/api/handlers,internal/metadata,internal/catalogandinternal/adminjobpass, with two exceptions unrelated to this change.TestAdminResourceCapabilitiesAndScopefails on macOS only, because resource sampling is Linux only. Three adminjob library-deletion tests (TestLibraryDeletionAcceptanceAtomic,TestLibraryDeletionCompetingAcceptanceAndInsertRollback,TestOnlyARecoveredLibraryRefreshWaitsForTheLibraryLock) fail on my fresh local database at theadmin_jobs.created_by_user_idforeign key, because no user row is seeded there.scripts/ci/db-contracts.txt, pass through thedbpinsrunner against a migrated PostgreSQL 18 database with pgvector. The existing queue, split-pin and refresh DB tests ininternal/metadata(206) also pass. Removing the scan-retry guard or the clear-on-match each makes the handler DB test fail.tscis clean, ESLint on the changed files shows only an existing warning, and Prettier is clean.verify-apiv2-openapi,verify-apiv2-web-types,verify-apiv2-fixtures,verify-route-inventory,verify-migration-ledgerandmigrate-validatepass.verify-apiv2-contractagainst main reports 5 additive changes and none breaking.make test-go, the fullmake test-db-pins(I ran only the new entries),make lint-changed,pnpm run buildand the bundle budget,verify-settings-bindings-allandverify-playback-fixtures.verify-local-pathscrashes under the macOS system bash; a search of the diff for local paths found none.0d2b6a9c0settles a pinned item's refresh-debt row when its refresh is skipped,f6e10092ewrites the mark only when it changes and wakes a shared series root's parked queue row on restore, andbd802a43bcorrects the refresh wording indocs/libraries-api.md.ff4e93503merges main and resolves thescripts/ci/db-contracts.txtconflict. On the merged head, the five DB contracts pass throughdbpinsagainst PostgreSQL 18 with pgvector, and the extended refresh and handler DB tests fail onc53c1c156and pass with the fixes. The fullinternal/metadataandinternal/catalogpackages also pass against that database.verify-apiv2-openapi,verify-apiv2-fixtures,verify-apiv2-web-types,verify-route-inventory,verify-migration-ledger,tscand the Libraries vitest files pass.Processcall adds one primary-key lookup, and the existing list, queue and refresh queries each gain one predicate.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-2438/
Surface and build: web admin, Libraries tab, Unmatched Items, at desktop and phone width. Before is upstream main
6144c45cd; after is this branch atab291a52f. Both ran locally against the same database and test media.API totals for the same library at each step
unmatched-itemstotal?ignored=truetotalRisks
local-ID comes from its file path, so renaming or moving the file brings it back as a new unmatched item, and so does a new file version added beside an ignored movie.Checklist
AI Disclosure
docs/architecture/api-contract.md, wasn't taken, because that count covers only the operations ported from v1.Note
Add admin ignore mark for unmatched library items
match_ignored_atcolumn onmedia_itemsso admins can mark an unmatched movie or series as intentionally unmatched.ignoredfilter on the unmatched-items listing and anignore_unmatchedcapability flag.UpdateMetadataTx);pinnedUnmatchednow covers both the ignore mark and unmatched splits; ignored series-child refresh returnsErrMetadataNotFound; v1GET /libraries/unmatched-itemsnow explicitly excludes ignored items.Macroscope summarized ff4e935.