Release: the series job, Keep → Sonarr dubs, akon rename and transcode agents #2
Loading…
Reference in a new issue
No description provided.
Delete branch "develop"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
mainis the release branch and has not moved since 2026-11-10. Production has rundevelopbuilds since the cutover (now6b877566), somainno longer describes what is deployed. This PR brings it up to date: 171 commits, 511 files (+19.9k / −49.8k).What changes
The series job replaces the per-step pipeline (SJ-1 … SJ-11, cutover, rename)
worker.concurrency,series.torrents_at_once); Promote puts a series first.adm report joband the old pipeline are removed. Running and Intake show series./var/lib/akon,akon-develop.sqlite, the qBittorrentakon-tags and category,akon-install.Keep → Sonarr, Shoko, Jellyfin
adm sonarr find-dubs).Errors and resilience
Identity and search
adm retitle.Transcode agents
adm agent: pack, install, upgrade, rollback, status and token foradm-agent.pyz. Agents must match the worker'sAGENT_VERSION.out_time. The source is read once, and the agent returns the upload's SHA-256.Admin and installer
adm series --id <anidb>(retry, keep, reject, search, cancel, promote).admnever opens the database: it asks the API over the admin socket.b06f7e3c, the only commit here not yet on production).Dashboard
Testing
developthrough6b877566since 2026-11-28, including the cutover and the rename.adm services checkreports every service OK.d3298176(2026-11-27). Later commits were tested with their own targeted tests, not a new full-suite run.Not in this PR
developand is still open.🤖 Generated with Claude Code
Season packs on production stopped in review although their files were fine: - File names: bracketed CRC32 hashes ([E02FF655]) no longer read as episode numbers or ranges; "S2 - 10" is not a range; "S02E01v2" and "S04E01 v2" keep their episode; "4th Season_-_07_" reads season 4 episode 7; an episode title after the tag ("S02E03 - 0 + 2 = 1") is ignored; half episodes ("- 20.5") are extras. - External audio and subtitle tracks (.mka, .mks, .sup ...), covers and checksum files are allowed beside the videos. - A TVDB season/number listed twice blocks only a file that maps to it. - A planning error stops VERIFY_RELEASE once with SEASON_PACK_FILES_UNCLEAR instead of three retries ending in JOB_RETRY_EXHAUSTED. Identity: when the title finds the right series but another AniDB entry (the alternate title of season 1, or the first cour of a split season), the Anime-Lists entry for the release's TVDB season and episode is used (Slime S04 -> 18884, AMAIM S01E14-E25 -> 17091). Movies are not supported yet: VERIFY_RELEASE cancels a movie (AniDB type Movie, or a movie title with no season or episode) with RELEASE_MOVIE_SKIPPED, posts a MOVIE_SKIPPED notification and closes the operation. Migration 074 adds the notification type. Co-Authored-By: Claude Opus 5.5 <[email protected]>Identity (60 IDENTIFY_ANIME reviews): - Fuzzy title matching took its words from the space-stripped text, so the "word" was the whole title: typos ("Alyu" for "Alya") and particle spellings ("wo"/"o") never matched. Words now come from the original text. - Aliases gain cleaned forms: dotted titles ("Magic.Kaito.1412"), trailing years ("LIAR GAME 2026", "Look Back (2024)"), "- Season", "A (B)", an unbalanced "(", and a trailing "(Aoki Denshou: Welsh & Shedar, Dual-Audio)". They are searched and scored; scoring no longer sees only variants still carrying "(Season 01)" or ". . .AVC". - A sequel entry ("Black Clover 2nd Season", "Mushoku Tensei III") agrees with TVDB through any AniDB entry Anime-Lists maps to the same series. - A movie title whose identity is not found is canceled with RELEASE_MOVIE_SKIPPED and a notification, not left in review. Releases: an absolutely numbered series reads "One Piece S01E1160" as absolute episode 1160. Retries and cleanup: - STAGING_UNAVAILABLE waits 2, 4, 6 minutes (was 1s/2s/4s, so a brief NFS outage exhausted every retry) and records the failed check. - Cancellation cleanup waits on ENOTEMPTY/EBUSY (NFS keeps deleted, still open files briefly) instead of stopping for review. - A magnet that timed out waiting for its file list is removed through the normal cancellation cleanup. - CLEANUP_BATCH_DOWNLOAD records the check that stopped it. Co-Authored-By: Claude Opus 5.5 <[email protected]>- Anime-Lists writes a word instead of a TVDB ID for entries with no TVDB series ("movie", "OVA", "hentai", "web", "tv special", "music video", "other"). It read as a broken provider response, retried until exhausted and stopped in review (Look Back, Land of the Lustrous). "movie" is now canceled as RELEASE_MOVIE_SKIPPED with the movie notification; any other word as ANIME_LISTS_ENTRY_MISSING. - An aired episode Anime-Lists does not place on TVDB is searched by its AniDB number with no TVDB season; building its titles compared None > 1 (Black Clover S02E02 discovery, TypeError). - Reset "replay" refused Auto BR deliveries, which carry only the release name and info hash; the pipeline builds the magnet from the hash. Co-Authored-By: Claude Opus 5.5 <[email protected]>For the Running page ("downloading, 53%"); the series job reads them from the one sync/maindata call that covers every torrent. Co-Authored-By: Claude Opus 5.5 <[email protected]>Production, 2026-11-27: One Piece (absolute numbering) has no TVDB episode in its search target. The reason written for a result that did not match formatted S{season:02d}E{None:02d}: TypeError, and the series stopped as a program error. A season pack's parsed episode is None the same way. episode_label() writes S01E05, S01, E1160 or 'unknown' from what is known; the test searches a target with no TVDB episode against an other-episode result and a pack. Co-Authored-By: Claude Opus 5.5 <[email protected]>Production, 2026-11-27: the dashboard showed nothing and made no request. At load, dashboard.js attached listeners to the Jobs page's controls (search, status filter, select page, bulk buttons, next/previous page), removed with the per-step jobs; $('search') was null and the TypeError stopped the whole script. Those listeners go. dashboard_load.js runs the script at load against a page with exactly index.html's IDs: it fails on the deployed version at the same line and passes now. A dashboard page that is not there (the old /jobs, a mistyped address) redirects to Intake, under /, /akon or /anime-discovery; files and API routes still answer their errors. Co-Authored-By: Claude Opus 5.5 <[email protected]>Owner, 2026-11-27: each reload found the next element or route the series job had removed. dashboard.js (2122 lines, written for the per-step jobs) loses what can no longer run: the Jobs list and its controls, bulk actions, job history, job matching and coverage, the transcode batch panel and the old series view (now 1404 lines). Intake's loader is Intake only; a release added by hand goes to /series/{id}/release (its old route was gone); the history dialog goes. Static checks (test_dashboard_static.py), in the normal suite: every element the script looks up is on the page, every API path it requests is served. On the deployed script they report all 15 missing elements and 10 dead routes at once. dashboard_load.js runs the script at load for all four pages. What the series job records is shown now: why a torrent waits or stopped (staging full, storage not mounted, ...), a series stopped by a program error, why a Keep stopped, the next check time, and the series' recent history. A browser test of every page against the real API is written up for later: docs/DASHBOARD_BROWSER_TEST.md. Full suite: 1063 passed, 2 skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]>Owner, 2026-11-28: 'I want to watch this first', or a failed series retried and then put first. A promoted series is the next one a free lane takes, before every other series (the latest promotion first), and a sleeping one is woken. Its own column (migration 081, promoted_at_ms): the worker's save of a series it holds never writes it, so a promotion made meanwhile stays. - API: POST /series/{id}/promote and /unpromote; decided series are refused. - adm series --id N --promote | --unpromote, alone or with an action (adm series --id 69 --retry --promote). - Dashboard: Running lists promoted series first (marked), with promote/unpromote per row; the series view has promote/unpromote next to retry. Full suite: 1083 passed, 2 skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]>An outage that made a step or a series wait logged a warning on every attempt (about 430 lines in two hours on production) and was never saved, so the dashboard and adm showed a step that did not move with no reason. A wait is now logged and noted once, when it starts or its reason changes. The torrent keeps the reason in its why ('STORAGE_UNAVAILABLE: ...') and the series in work['waiting'] until a step gets through, which notes that the wait is over. adm running, adm series and the dashboard show it. Co-Authored-By: Claude Opus 5.5 <[email protected]>Production, 2026-11-29: a root adm that opened the database could leave its -wal/-shm owned by root, and the worker failed with "attempt to write a readonly database". - The admin socket takes {"command": "api", ...} and runs the dashboard's own routes behind sign-in (Application._signed_in); being local as root or the service account (SO_PEERCRED) is the sign-in. The HTTP path is unchanged. - adm series, running, shoko link, sonarr find-dubs and services check go through it (new routes: series/N/shoko-link, series/N/find-dubs, services/check). With the API stopped adm says so (exit 3). - adm retitle --apply asks the worker (v82 worker_requests): the worker finishes the series it holds, starts none, retitles, and goes on. It no longer has to be stopped. Staging not mounted waits; a program error fails the request with where. - A test fails if any adm command imports the database, settings or secrets. Co-Authored-By: Claude Opus 5.5 <[email protected]>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.