This was generated by AI during triage.
Agent Brief
Category: bug
Summary: A .torrent whose info.name is only a season folder (for example Season 2) reads as a release with an empty title, so apply finds no candidate.
Current behavior:
Search reads the tracker listing title, finds the local season pack, and accepts it. At add time, apply reads the downloaded .torrent through readApplyTarget → readRelease. The info.name is a bare season folder, which parses as a series with season 2 and an empty title, no year, no resolution, and no group. The files inside carry the full identity (title, year, SxxEyy, resolution, group), but readRelease takes only season, episode, and pack shape from them (selectSourceReleaseForSearch / mergeSeasonPackSearchStructure keep the empty title of the name). The title check in findCandidates then rejects every local torrent, and the add fails with "No matching torrents found with required files". If only the title were filled in, searchCandidateMetadataConsistent would still reject the pair as a resolution mismatch against the replayed search decision.
Desired behavior: When a release name parses with a season but no title, the Read release takes its identity (title, year, resolution, source, codec, group, and the other release fields) from the largest file, and keeps the season pack shape of the name: type series, the season of the name, episode 0.
- Borrow only when the season of the file agrees with the season of the name. A file from another season lends nothing.
- A name with a title is read as before.
- The replayed search decision and the file comparison still run, so a
Season Ntorrent of a different show is still rejected. - The rule lives in
readRelease, so every Match path that reads a release (search source, apply target, replay) gets the same Read release.
Key interfaces:
readRelease(): for a titleless season-folder name with files, returns a Read release whose title, year, resolution, and group come from the largest file of the same season.readApplyTarget(): gets the fix throughreadRelease. The apply-target policy drops files for a TV name when it does not replay a search. Decide whether the titleless borrow runs before that, and cover the choice with a test.
Acceptance criteria:
- A reader test: name
Season 2with files shapedShow (Year) - S02E01 - Episode (1080p ... Group).mkvreads title, year, resolution, and group from the files, with type series, season 2, episode 0. - A reader test: name
Season 2with files from season 3 lends no identity from the files. - An apply test that replays a search decision against a .torrent named
Season 2with files of the same show as the local pack: matched. - The same apply test with files of another show: rejected.
- A name with a title reads exactly as before;
TestMatchCorpus,TestReadApplyTarget*, andTestCrossSeedDerivesTargetStructureFromMetainfoFilesstill pass. - New match corpus rows for the season-folder shape.
Out of scope:
- Changing how names with a title borrow from files.
- Relaxing
searchCandidateMetadataConsistentor the title check infindCandidates. - Fallbacks for names that carry no season either.
Domain:
- Glossary terms: Read release, Title key, Match path. "Season folder name" is not a glossary term; the brief uses it only as a description.
- ADRs: ADR 0008 (matching rules read releases and file lists only). The fix reads only the name and the file list, so it agrees with it.
- Owner:
readRelease, the one reader of a release name.
Logs:
- None
The reporter runs a local patch on v1.33.0 with these tests and offered to open a PR.
From discussion #3347
Activity
0No activity yet.