Skip to content

feat: add Manual Selection rip mode (pause after scan for multi-select) - #144

Merged
negativeeddy merged 4 commits into
masterfrom
fix/manual-selection-rip-mode
Aug 29, 2026
Merged

feat: add Manual Selection rip mode (pause after scan for multi-select)#144
negativeeddy merged 4 commits into
masterfrom
fix/manual-selection-rip-mode

Conversation

@negativeeddy

@negativeeddy negativeeddy commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a third rip mode, Manual Selection, alongside the existing Main Feature and All Titles modes. In Manual mode, the pipeline pauses after the MakeMKV title scan and waits for the user to multi-select exactly which tracks to rip.

What changed

Core

  • JobState.ManualSelectionStarted — new state for the paused-waiting-for-selections phase
  • ArmSettings.ManualSelection — new bool setting (defaults to false)
  • ConfigSnapshot.ManualSelection — per-job snapshot of the setting
  • SystemDrive.ManualSelection — per-drive override (null = use global)
  • Job.ManualSelectionResume — flag to signal the pipeline to continue
  • Job.ManualSelectionTrackNumbers — JSON array of selected track numbers

Pipeline

  • After MakeMKV scan + DiscDb mapping, if ManualSelection is enabled, the pipeline enters ManualSelectionStarted state and polls for user input indefinitely
  • When the user submits selections, Process flags are updated to only rip selected tracks
  • Works for both movies and TV series

API

  • POST /api/jobs/{id}/manual-selection — accepts { trackNumbers: ["1", "3", "5"] } and resumes the pipeline

UI

  • Settings page: Manual Selection toggle in the Ripper tab (with tooltip explaining the feature)
  • Drive selector: "Manual" option added to the per-drive dropdown
  • Job Detail page: Track table shows checkboxes when in ManualSelectionStarted state, with a "Select All" checkbox and "Continue Rip" button
  • SignalR: Live updates handle the new state in dynamic button injection

Behavior

  • When Manual Selection is enabled globally or per-drive, the pipeline pauses after the title scan
  • The user sees the full track table with checkboxes (DiscDb-promoted tracks are pre-checked)
  • The user selects/deselects tracks and clicks "Continue Rip"
  • Pipeline resumes ripping only the selected tracks
  • Wait indefinitely until the user clicks Continue (no timeout)
  • Cancel button remains available during the wait

Closes #76

Fixes (post-review)

  • Stale job entity: the pipeline's tracked job was not reloaded after the manual-selection wait, so the selection persisted by the API (via a separate DbContext) was silently ignored and the MainFeature branch ripped the wrong track. The job is now reloaded after the wait.
  • Branch selection: when a manual selection is applied, the MainFeature and rip-all fast-path branches are skipped so the individual-track branch respects the chosen Process flags.
  • Spurious stage error: the status was set to VideoRipping before the identify guard ran, recording a false stage error (yellow Identify in the UI). The status now stays ManualSelectionStarted through the guard, and the guard accepts that state as a valid pre-rip state.
  • Regression test: ManualSelection_AppliesUserSelection_AfterResume covers selection application, branch selection, and absence of spurious stage errors.

ARM Dotnet Port added 4 commits August 19, 2026 13:22
Add a third rip mode (Manual) alongside Main Feature and All Titles.
When enabled, the pipeline pauses after the MakeMKV title scan and
waits for the user to multi-select which tracks to rip.

Core changes:
- Add ManualSelectionStarted job state
- Add ManualSelection bool to ArmSettings, ConfigSnapshot, SystemDrive
- Add ManualSelectionResume and ManualSelectionTrackNumbers to Job
- Pipeline pauses after title scan when ManualSelection is enabled
- User selects tracks via checkboxes, clicks Continue Rip
- API endpoint POST /api/jobs/{id}/manual-selection submits selections

UI changes:
- Manual Selection toggle in Settings (Ripper tab)
- Per-drive Manual option in the drive selector dropdown
- Track table shows checkboxes when in ManualSelectionStarted state
- Select All checkbox and Continue Rip button
- SignalR live updates handle the new state

All 469 tests pass.
The previous implementation used a while(true) + Task.Delay(2s) polling
loop that needlessly woke the pipeline every 2 seconds to check a DB flag.
This wastes CPU and could interfere with the UI.

Replace with a TaskCompletionSource<int> per job. The pipeline awaits
the TCS with zero polling; the API endpoint completes it when the user
submits their selection. Cancellation is handled via a linked
CancellationTokenSource so job abort/shutdown also wakes the pipeline.

- Add static ConcurrentDictionary<int, TaskCompletionSource> to ArmRipperService
- Add SignalManualSelection / CancelManualSelection static methods
- API endpoint calls SignalManualSelection after persisting selections
- Remove unused ManualSelectionResume field from Job
- All 469 tests pass
- Reload the job entity after the manual-selection wait so the selection
  persisted by the API (via a separate DbContext) is actually read; the
  tracked entity was stale, so the selection was silently ignored and the
  MainFeature branch ripped the wrong track.
- Skip the MainFeature and rip-all fast-path branches when a manual
  selection was applied, so the individual-track branch respects the
  chosen Process flags.
- Don't set VideoRipping before the identify guard runs — it tripped the
  guard and recorded a spurious stage error (yellow Identify in the UI).
  The guard now also accepts ManualSelectionStarted as a valid pre-rip
  state.
- Add regression test covering selection application, branch selection,
  and absence of spurious stage errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New rip mode: Manual selection (Main/All/Manual) — pause after title scan for multi-select

1 participant