Skip to content

Mixed libraries classify episodes in a TVDB-tagged show folder as a movie #1642

Description

@Quick104

Problem

In a Mixed library, episodes in a show folder that has a {tvdb-…} tag but no season folder are classified as a movie. With Show (2024) {tvdb-12345}/Show S01E03.mkv and Show S01E04.mkv, both files become movies with the same movie group key (v1|movie|anchor|tvdb-12345), so the show turns into one movie instead of a series. The root is resolved with high confidence, so it doesn't appear under Ambiguous Roots. Only a folder with a single episode gets flagged as ambiguous. Sonarr's folder naming can add the show's TVDB ID, which produces this layout.

The Mixed classifier checks, in order: season folder, then movie-folder evidence, then an episode token. Any provider tag on the parent folder counts as movie-folder evidence, whatever the provider. Checking movie-folder evidence before the episode token is deliberate: a tagged movie whose title looks like an episode code must stay a movie (the "mixed library obvious movie folder beats episode token" case, which uses {imdb-…} {tmdb-…} tags). The question here is narrower: should a TVDB tag count as movie-folder evidence?

TVDB also lists movies, and Silo accepts a TVDB ID as a movie anchor (last in the movie precedence), so a TVDB tag doesn't prove a series.

I found this by reading the code and tests while auditing the docs for #1635, and confirmed it with a throwaway unit test calling ResolvePathContext, InferRootAssignments, and InferGroupIdentity. I didn't run a library scan.

Options

  • Don't count a TVDB-only tag as movie-folder evidence. The file then falls through to the episode-token step, so episodes become series. A tagged movie with no episode-like name still defaults to movie. This is the smallest change. A folder that also carries a TMDB or IMDb tag keeps today's behavior.
  • Treat a TVDB tag as series evidence when the file also has an episode token, even next to other tags. This covers Sonarr folders with several IDs, but it flips a movie whose title looks like an episode code if its folder carries a TVDB ID.
  • Keep the current behavior and document that episodes in a Mixed library need a Season NN folder. docs: cover every folder and filename form Silo reads, Mixed classification, and Ambiguous Roots siloserver.org#41 asks the manual for that note.

For the first two options, pin the behavior with new cases:

  • TestResolvePathContext: /mixed/Show (2024) {tvdb-12345}/Show S01E03.mkv → series; /mixed/Movie (2020) {tvdb-12345}/Movie (2020).mkv → movie.
  • An InferRootAssignments plus InferGroupIdentity case with two episodes in a TVDB-tagged folder: expect series assignments and a series group, not one movie group.
  • Keep "mixed library obvious movie folder beats episode token" unchanged.

Technical notes

  • Classification order: ResolvePathContext, internal/naming/filename.go:80–88; extractPathEvidence, internal/naming/root_inference.go:308–316.
  • Evidence: detectInferMovieFolderEvidence (internal/naming/root_inference.go:421) returns true for any ParseFolderIDs(parentBase) hit at line 425.
  • Single-file ambiguity: the episode-token contradiction at root_inference.go:296, and the ObservedFileCount == 1 rule at line 175.
  • Movie anchor precedence includes TVDB: movieProviderPrecedence, internal/contentid/contentid.go:92.
  • Existing tests that keep the deliberate order: TestResolvePathContext ("mixed library obvious movie folder beats episode token", internal/naming/filename_test.go:423; "mixed library id tagged movie folder beats divergent release filename", line 570), TestParseFilename (line 168), and TestDetectSeriesRoot ("mixed library movie folder beats bare episode token", line 69).

AI disclosure

  • Harness: T3 Code (Claude Code agent harness)
  • Tool(s): Claude Code, GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: AI-assisted; filed at the maintainer's request
  • Adversarial review: n/a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions