Repository navigation
Fix IMDb ID parsing and remove the discontinued SDBits provider - #12327
Conversation
Normalize complete title IDs from paths and URLs, reject unusable values, and guard Series fallbacks plus provider and Trakt consumers of missing IDs. Add regression coverage for the reported TVDB value, malformed metadata, supported formats, and completion of the actual add-queue path.
|
Just a quick note, since you've made changes to SDBits: it can be removed. The provider is down for good. |
Remove its provider module, dedicated IMDb tests, frontend fixture entry, and theme icons following review feedback on the IMDb parsing fix. Provider discovery and legacy configuration handling need no changes.
|
@duramato Thanks for the heads-up. I've removed SDBits in a separate commit. I included that cleanup in this PR because I'd already touched its IMDb handling. Any other dead providers should be reviewed in a separate PR so this one stays focused on the IMDb fix and the related SDBits removal. |
|
Maintainers: please rerun the Windows / Node 22 frontend job once the network issue fetching dependencies from the Yarn registry is resolved, so all checks can complete successfully. It failed during dependency installation with |
|
Thanks! |
🎯 Why
This fixes a show-add blocker: malformed optional IMDb metadata can prevent affected shows from being added at all. The failure aborts the add task before the show is saved.
The confirmed example is MAGICAL GIRL RAISING PROJECT restart (TVDB 457780): TVDB returned the series successfully, but parsing its IMDb field raised an uncaught exception. Retrying, including after a restart, left the show absent while Medusa itself remained running.
Optional IMDb metadata should be normalized when usable and safely rejected otherwise, so malformed values do not abort an otherwise valid show addition.
This PR also removes the discontinued SDBits provider following feedback from @duramato.
🛠️ Changes
The IMDb fix is limited to Medusa's parser and its immediate callers; SDBits retirement is a separate cleanup. Vendored
imdbpie, dependencies, queue implementation, and homepage behavior are unchanged.🔗 Related caller changes and why they are needed
The parser returns no identifier for malformed values, so the remaining callers guard that result at existing call sites:
ttprefix; skip its IMDb-only search when the ID is unusable instead of slicingNoneNone == NoneValid searches, valid IMDb matches, and primary-indexer matching retain their existing behavior. These remain small guards around the parser's rejection result.
🧹 SDBits removal
@duramato reported that SDBits is permanently closed. I removed its provider module, four dedicated regression cases, fixture entry, and three theme icons. This cleanup does not redesign any other provider.
✅ Validation
I verified the changes through regression tests, the earlier live UI add, isolated runtime checks, frontend checks, and fork CI:
457780/providers/sdbits; live database and config hashes were unchangedThe PR contains two signed commits based on
develop: the original IMDb fix and a separate SDBits removal. The remaining IMDb code is unchanged; the SDBits startup checks used isolated data.I compared the current fork validation run, original upstream PR run, and unchanged upstream
developrun at base 660bc2a. All three passed with 91 passing, 0 failing, 0 errors, 14 skipped, while displaying the same threeShow folder does not exist.annotations atmedusa/tv/series.py:423.The Dredd add test queues TVDB
80379without a show directory. Banner, poster, and fanart lookups each raise a directory exception that Medusa catches and logs as a warning with a traceback. GitHub's Python log matcher turns those tracebacks into error annotations; the API assertions still pass.These annotations predate this patch. The directory-validation, image-cache, and API-test paths responsible are unchanged; their cleanup remains outside this IMDb fix.
🔎 Evidence
Download the before/after logs and console trace.
🔁 Reproduction and original failure
457780.TVDB returned this IMDb field for series
457780:The old parser selected the final slash-separated component, split it on
tt, and attemptedint('ep'):Adding the show through TVDB stopped before persistence. Four recorded attempts ended at the same point, including attempts after restarting Medusa. The same parser failure was reproduced from upstream
developat 660bc2a.The fixed parser extracts
tt6135388/6135388. The regression retains the exact input independently of future TVDB metadata changes. This validates the ID's format, not whether the external mapping points to the correct title.📋 Successful live add: console, log, and database evidence
I repeated the UI add on dc17f43, on 2026-10-06, AEDT (UTC+11). This is historical runtime proof from the earlier candidate; the IMDb code is unchanged in 6aa24e4.
Browser console excerpts:
Application log excerpts:
I confirmed persistence using read-only SQLite queries:
HTTP 201 establishes acceptance; the database rows and subsequent frontend-store insertion establish successful addition. The final IMDb ID follows existing external-indexer lookups; the original malformed-input regression is a separate check.
The console also contains Vue/store
show is undefinederrors and CSS warnings. Those frontend issues remain outside this fix. No recurrence of the original IMDb parsing exception appears in the captured add sequence.🧪 Regression coverage and validation notes
QueueItemAdd.run()completion. The 108 core parser/Series cases went from 83 failed / 25 passed against the original methods to 108 passed.TZ=UTCand a process-only PATH excluding the host's ffprobe. The normal PATH exposes an existing fixture mismatch (ffprobe not availableversus installed8.0.1), also reproduced with the original methods. No test expectation was changed.git diff --checkpassed. Configured lint passed with the repository's global pytest exclusions; Trakt's two existingE275warnings were confirmed against the base and excluded for its local lint check.developat 660bc2a. The two-commit candidate ending at 6aa24e4 passed 26 Actions jobs and both Codecov checks in draft Pull from upstream #17. I reviewed its annotations against unchanged upstream code; the existing API messages and frontend lint warnings remain unrelated to these changes.☑️ PR checklist
develop; separate commits for the IMDb fix and SDBits removal.