feat: mid-rip main-feature redirect with smarter track selection - #72
Merged
Conversation
added 2 commits
August 15, 2026 09:26
- SelectMainFeatureTrack: longest eligible track wins, tie-broken by file
size, chapter count, then (optionally) widescreen, then duration; falls
back to longest overall when nothing is eligible
- RipRedirectService: singleton registry of active MakeMKV rips so the UI
can request a mid-rip redirect (cancel + re-rip the chosen track)
- Main-feature rips honor a per-job override and a per-fingerprint override
remembered for future rips of the same disc; partial output is cleaned up
before re-ripping
- New POST /api/jobs/{id}/redirect-rip endpoint plus a Redirect button on
the job details track table (antiforgery-token aware)
- EF migration AddMainFeatureRedirect + legacy DB column sync
- Tests: main-feature selection, override/redirect pipeline, API endpoint
The abandon fetch posted without a token, so [ValidateAntiForgeryToken]
on /api/abandon/{id} rejected it with a 400. Render a hidden token in the
shared layout and send it as the RequestVerificationToken header.
added 2 commits
August 15, 2026 11:28
- RipRedirectService.BeginRip registers the CTS before checking the pending
redirect flag, closing the race where a redirect landing between the check
and the store would be lost.
- CleanupPartialRipOutput now deletes only the cancelled track's output file
(exact MakeMKV FileName or _t{TrackNumber-1:D2}.mkv suffix) instead of every
.mkv in the raw output dir, so a good file from an earlier rip of the same
title is preserved.
- Rip-pipeline tests use the real 1-based MakeMKV track convention (track 1 →
title_t00.mkv), so the mid-rip redirect test exercises the track-scoped
cleanup; DamagedDisc assertion updated accordingly.
- Document remaining review findings 37-40 in docs/code-review/.
…edirect # Conflicts: # docs/code-review/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the case where a disc's automatically-selected main feature is wrong (e.g. a featurette marginally longer than the movie) by letting the user redirect a rip in progress to a different track. The choice is remembered per disc fingerprint for future rips.
What changed
Track selection (
ArmRipperService.SelectMainFeatureTrack)Mid-rip redirect (
RipRedirectService, new)Overrides
Job.MainFeatureOverrideTrackNumber) set from the UI.DiscMetadata.MainFeatureTrackNumber) remembered across rips of the same disc.API + UI
POST /api/jobs/{id}/redirect-ripendpoint (antiforgery-token protected).Data
AddMainFeatureRedirect+ legacyDatabaseHelpercolumn sync.Tests
SelectMainFeatureTrackunit tests (ties, widescreen, eligibility, fallbacks).redirect-rip(persist override, missing job, unknown track, non-ripping job).All 244 Core + 77 WebUi tests pass.