Summary
The in-flight NZB season-pack coalescing lookup in queues/scraping_queue.py matches a sibling by show, season, state, and nzb: job ID, but it does not include the requested version. This can allow an episode requesting one version to inherit a sibling season-pack job for a different version.
Reproduction
- Enable granular versions such as
1080p and 2160p.
- Have one episode in a season already bound to an in-flight NZB season-pack job with version
1080p or 1080p*.
- Process another episode from the same show and season with requested version
2160p.
- The sibling lookup can select the 1080p row and reuse its NZB job for the 2160p request because the query matches only IMDb ID and season.
Expected behavior
Season-pack reuse should require the normalized requested version to match the normalized sibling version. A decorated value such as 1080p* should remain compatible with 1080p, but 1080p should never satisfy 2160p.
Suggested fix
Normalize the current item version by removing *, then include equivalent normalization in the sibling query:
AND REPLACE(COALESCE(version, ''), '*', '') = ?
This follows the normalized-version comparisons already used elsewhere in the queue/database code.
Regression criteria
- An in-flight
1080p* season-pack job may be reused by a 1080p episode.
- An in-flight
1080p job must not be reused by a 2160p episode.
- Existing same-version season-pack coalescing behavior remains unchanged.
A focused local SQLite regression test confirmed the mismatch before the filter and the expected separation after adding normalized version equality. The change is isolated to the sibling NZB coalescing lookup.
Summary
The in-flight NZB season-pack coalescing lookup in
queues/scraping_queue.pymatches a sibling by show, season, state, andnzb:job ID, but it does not include the requested version. This can allow an episode requesting one version to inherit a sibling season-pack job for a different version.Reproduction
1080pand2160p.1080por1080p*.2160p.Expected behavior
Season-pack reuse should require the normalized requested version to match the normalized sibling version. A decorated value such as
1080p*should remain compatible with1080p, but1080pshould never satisfy2160p.Suggested fix
Normalize the current item version by removing
*, then include equivalent normalization in the sibling query:This follows the normalized-version comparisons already used elsewhere in the queue/database code.
Regression criteria
1080p*season-pack job may be reused by a1080pepisode.1080pjob must not be reused by a2160pepisode.A focused local SQLite regression test confirmed the mismatch before the filter and the expected separation after adding normalized version equality. The change is isolated to the sibling NZB coalescing lookup.