Post-grab async background swap, upgrade_locked flag to prevent the
upgrade loop from re-inflating a locally-transcoded file, and a
transcode-library CLI backfill for the existing catalog. Bitrate model
calibrated against Silicon Valley's real HEVC bitrate, scaled by
resolution and AV1's encoding efficiency. HDR/2160p and anime excluded
from this first pass. Jellyfin session polling throttles batch
encoding back to 1 stream during active playback.
The "reject sub-1080p when a better resolution exists in this batch" gate
(and every other quality gate) only ran on the confident auto-match path —
a low-confidence match skipped straight to queue_for_review before ever
reaching it. A human review decision is about whether this is genuinely
the right show, not a backdoor around quality standards; a title match
being ambiguous is no reason to let a worse-quality release through
untested. Verified live: several 720p season-pack releases were sitting in
the review queue for shows that also had 1080p+ alternatives in the same
search batch. Moved the gate check ahead of the review-queue branch so it
applies uniformly.
process_item queued anything landing in the matcher's "needs review"
confidence band immediately, without ever checking whether the show/
season/episode/movie actually needed anything — that check only ran on
the auto-match path. A low-confidence match against an already-complete
show gained nothing from a human's yes/no, it was just noise that
reappeared every cycle the source kept re-listing the same old release
(verified live: fully-complete shows' season-pack re-releases piling up
in the review queue indefinitely). Reordered so the eligibility check
(movie/season-pack/episode) runs first regardless of confidence, and only
a genuinely-needed release ever reaches the queue-for-review decision.
SEASON_PACK_RE only matched an explicit parenthesized "(S01 Complete)"
form, so any other real-world season-pack naming convention — bare
"S10.COMPLETE", spelled-out "Season 8 Complete", "[Season 4 Four
Complete]", or no "Complete" marker at all ("Game of Thrones - Season 8
S08 - 2019") — came back with season = None entirely, not just an
unresolved episode. That fed straight into review-queue approvals
returning "could not resolve which episode this release is" for releases
that were genuine, resolvable season packs. Broadened to a bare season
marker, safe here since this is only reached after SXXEXX_RE/SXX_DASH_EP_RE
have already failed to find a real episode number.
Library tab gets a cycling filter (all/series/movies/missing/unmonitored)
and sort (title/missing/kind), color-coded kind tags and missing-count
severity, and monitor-toggle without opening detail. Keybinding hints move
out of cramped block titles into a context-aware status bar plus a `?`
help overlay, both driven by one shared keybinding table so they can't
drift apart. Episode status icons and review-queue confidence get the same
severity coloring. Stuck tab gains real selection/focus and can jump
straight to a show's Library detail (needed adding media_item_id to
StalledGrab's query — the one small backend touch in this pass). Adds a
manual refresh-now key.
Search results were sorted purely by seeder count, so a season pack only
won out over a single-episode release by accident. Season packs already
clear every missing episode of that season in one grab and go through the
same seeder/quality gate as anything else (an unviable pack still gets
rejected there and iteration falls through to the next candidate) — so
sorting packs first, seeders as the tiebreaker, is a strict improvement
with no new risk. Shared by both the automated search cycle and the
manual-search candidate list.
Season 0 is TVDB's catch-all for specials/recaps/shorts and often a tie-in
movie already tracked as its own separate media_item (verified live:
Chainsaw Man's season 0 included a movie already present as its own entry).
Monitoring these by default means the library never actually "completes"
and inflates the missing-episode count with content nobody asked to
acquire as an episode. Regular seasons are unaffected.
Plain /episodes/default returns names in the show's original airing
language — for a lot of anime that's Japanese with no English name at all,
which is what was ending up embedded in generated filenames. TVDB carries
real crowd-sourced English translations at /episodes/default/eng (same
numbering/air-date fields, just a better name) — try that first and only
fall back to the original-language endpoint if a show has no English data.
TVDB has no English episode title at all for some shows (entire seasons of
otherwise-English-titled shows came back Japanese-only) — using it verbatim
put unreadable-to-most-tooling script into an otherwise Latin-script library.
Falls back to the no-title filename shape instead.
"S01E01v2" (a fixed re-release of an episode) glued the version marker
directly onto the episode number with no separator, so the word-boundary
check after the digits never matched and the whole file fell through as
unparsed. Verified live: some shows had zero episode files linked because
every release happened to be a v2.
qBittorrent's newer WebUI API returns 204 (not 200 "Ok.") on login success,
and a JSON success/failure summary (not plain "Ok."/"Fails." text) from
torrents/add — both broke against the currently deployed version. Also had
scan_tv_root move already-tracked episode files into their Season NN
subfolder instead of just recording wherever they already sat on disk.
OrtEmbedder's tokenize -> tensor build -> mean-pool -> L2-normalize
pipeline was near-byte-identical to breadmill's own OrtEmbedder (same
truncation, same actual_seq.min(mask.len()) padding guard, same 1e-10
epsilon) — now both share bread_onnx::embedding::EmbeddingSession (path
dependency for now, see the TODO in breadarrd/Cargo.toml). This crate
stays CPU-only (Provider::Cpu), matching its existing documented rationale.
ensure_model's reqwest-based download function is replaced with
bread_onnx::download::ensure_file (sync/ureq, matching breadmill's own
downloader and this workspace's bakery convention) dispatched via
spawn_blocking from this async context.
Builds and tests clean across the whole breadarr workspace: 205 passed, 1
pre-existing network-dependent test ignored, 0 failed.
Both import_one and import_season_pack_file deleted the existing
episode_file row and unlinked the on-disk file *before* link_or_copy_file
placed the new one. If the link/copy (or the free-space check) then
failed, the original content and its DB row were already gone with
nothing to fall back to.
Now the stale file is renamed to a sibling (freeing dest for the
hardlink fast path, same as before) and the DB row is left alone. Only
after the replacement is confirmed on disk are the file and the
old row cleaned up; any failure in between restores the original file
before returning the error.