Repository navigation
Description
Summary
Summary:
When an item with a stale TMDB ID is manually rematched to a correct TVDB result, it does not disappear from “Stale External IDs”. Instead, last_seen is updated and the item moves to the top of the list again.
Steps to Reproduce:
- Go to Admin Libraries → Stale External IDs.
- Pick an item with a stale TMDB ID, e.g.
Formula 1withtmdb=324880. - Click
Match. - Select the correct TVDB result.
- Click
Apply Match. - Check the stale list again.
Expected Result:
The item should disappear from the stale list after a successful rematch, especially when the corrected match only has a valid TVDB ID and no valid TMDB ID.
Actual Result:
The item remains in the stale list. last_seen is updated to the current time, causing the row to move to the top.
Likely Cause:
The newer /admin/items/{id}/match/apply flow does not appear to clear stale_media_ids the way the older stale-rematch endpoint does. Existing durable provider IDs also seem to be loaded during ModeIdentify, so the old stale TMDB ID may be carried forward even after selecting a TVDB-only match.
Example:
Formula 1 has a valid TVDB match, but the old tmdb=324880 appears to be reused and marked stale again.
Reply digest
When an item with a stale TMDB ID is manually rematched to a correct result from a different provider, it does not leave the "Stale External IDs" admin list; its last_seen is refreshed and it jumps back to the top.
Repro: Admin Libraries -> Stale External IDs -> pick an item with a stale TMDB id (e.g. Formula 1, tmdb=324880) -> Match -> select the correct TVDB result -> Apply Match -> the item is still in the stale list, now at the top.
Expected: after a successful rematch to a different provider the item should disappear from the stale list.
Root cause verified in code: the current "Apply Match" UI flow (HandleApplyItemMatch) runs metadata Process in ModeIdentify, which (a) re-injects the durable stale tmdb id via prepareProcessRequest, and (b) skips suppressRecordedStaleProviderIDs because that call is guarded if req.Mode != ModeIdentify. So the Phase-2 fetch re-queries the stale id, 404s again, and the post-persist DeleteByContentID + re-Upsert(provider404s) block (added in PR #38) re-inserts the stale row with a fresh last_seen_at. The stale list is ordered last_seen_at DESC, which is why the row resurfaces at the top.
Code references
Verified STILL OPEN at origin/main (46a6e86) as of 2026-07-02. The deprecated HandleRematchStaleID path clears correctly (wipes IDs + DeleteByContentID), but the live admin_match.go apply flow does not.
- internal/metadata/service.go:1094:
if req.Mode != ModeIdentifyexcludes the manual apply/identify path from suppressRecordedStaleProviderIDs, so the recorded-stale provider id is not stripped before the Phase-2 fetch and 404s again - internal/metadata/service.go:851-868 (prepareProcessRequest): re-injects the durable stale tmdb id into the identify request, re-arming the 404
- internal/metadata/service.go:1293-1310: after a successful identify, DeleteByContentID + re-Upsert(provider404s) re-creates the stale row with a fresh last_seen_at instead of leaving it deleted
- internal/metadata/stale_media_id_repo.go:120-131 (ListAll) + internal/api/handlers/libraries.go:2114 (HandleListStaleIDs): list ordered by last_seen_at DESC, so the refreshed row surfaces at the top
Attachments
None.
Source
Imported from Discord:
Activity
fix(metadata): stop manual rematch from resurrecting recorded stale I…
fluxis commentedon Jul 3, 2026
💬 bulderi in Discord:
good find, never noticed it. thanks
fluxis commentedon Jul 3, 2026
💬 bulderi in Discord:
yeah, will give it a go
fluxis commentedon Jul 3, 2026
💬 .coffeeknight in Discord:
I would test renaming the folder to tvdb id and re-scanning it, and see what happens after
fluxis commentedon Jul 3, 2026
💬 .coffeeknight in Discord:
I checked the imdb id and it also looks a bit weird. Tvdb has it as a series with 6 episodes of total of around 450 minutes. Imdb only seems to have one episode of 90min?
fluxis commentedon Jul 3, 2026
💬 bulderi in Discord:
the IMDB is correct but it isnt being used in silo since its in [ ]
fluxis commentedon Jul 3, 2026
💬 bulderi in Discord:
Yeah, that's what's weird. I get that the TMDB ID is stale, but I'm trying to fix it by matching it against the TVDB ID.
fluxis commentedon Jul 3, 2026
💬 .coffeeknight in Discord:
The tvdb id of 78232 is correct though. I didn't check the imdb id
fluxis commentedon Jul 3, 2026
💬 .coffeeknight in Discord:
Looks like your tmdb provider id is still wrong/stale.
https://www.themoviedb.org/tv/87054
This link leads to a 404 page, meaning the tmdb ID 87054 for TV shows was deprecated. Silo uses the term "stale" for it.
I'm not sure where that tmdb value of 87054 appears from though.
fluxis commentedon Jul 3, 2026
💬 bulderi in Discord:
fluxis commentedon Jul 3, 2026
💬 bulderi in Discord:
i get this in the logs ```2026/07/03 15:09:48 WARN tvdb: season translation fetch failed season_id=534970 lang=eng error="tvdb: HTTP 404: NotFoundException: error fetching translation"
fluxis commentedon Jul 3, 2026
💬 bulderi in Discord:
This issue is still not fixed for me. As shown in the images, I have an anime show with a stale TMDB provider. When I match it against TVDB, it isn't removed from the list, it just jumps to the top. The recent changes did, however, fix Formula 1 for me.
fix(metadata): stop manual rematch from resurrecting recorded stale I…