Skip to content

Fix: no-minlength-for-known-tracks v2 — removed SourceTitleId (wrong-track bug)#16

Merged
negativeeddy merged 8 commits into
masterfrom
fix/no-minlength-v2
Jul 19, 2026
Merged

Fix: no-minlength-for-known-tracks v2 — removed SourceTitleId (wrong-track bug)#16
negativeeddy merged 8 commits into
masterfrom
fix/no-minlength-v2

Conversation

@negativeeddy

Copy link
Copy Markdown
Owner

Summary

Resubmission of #13 (feat/no-minlength-for-known-tracks) with the critical SourceTitleId bug fixed.

What went wrong in v1

The original branch introduced SourceTitleId (MakeMKV field 24 — the 1-based disc title number) and used it in the mkv command. But MakeMKV's mkv command uses 0-based TINFO indices, so passing SourceTitleId=1 meant "rip TINFO index 1" (the second track — a short extra) instead of the main movie. Every DVD ripped wrong.

Quick comparison from the same disc:

master (✅) v1 branch (❌)
MakeMKV command mkv ... dev:/dev/sr1 0 mkv ... dev:/dev/sr1 1
Output t00.mkv (101 min movie) t01.mkv (2 min extra)

What's in v2

Keeps all the good changes from v1:

  • Damaged disc fallback: retry scan with normal minLength before falling back to RipAllTitles
  • minLength=0 for MainFeature/test mode rips (prevents MakeMKV from filtering out the track we already identified)
  • UI improvements (MKV title column, etc.)

Removed: All SourceTitleId code — models, enum, parsing, and the mkv command usage. RipTrackAsync passes trackNumber directly as it did before.

ARM Dotnet Port added 8 commits July 17, 2026 18:58
When the app already knows the exact track to rip (TestMode or MainFeature
modes), --minlength is counterproductive — it causes MakeMKV to filter out
the requested title if it's shorter than the threshold, resulting in exit
code 12 and zero output. The info scan already handles min-length filtering.

Also reverted unnecessary SourceTitleId parameter on RipTrackAsync — the
sequential TINFO index (TrackNumber) is the correct argument for the mkv
command, not the DVD VTS source title ID (field 24).
- Removed AddSourceTitleId migration (DB column not needed)
- Removed SourceTitleId property from Track, DiscTrack models
- Removed SourceTitleId enum value from MakeMkvModels
- Removed SourceTitleId parsing from MakeMkvService (field 24 is the DVD
  VTS title ID, not what makemkvcon mkv expects — it uses sequential index)
- Reverted NotificationHub.cs and Viewer.cshtml changes (log streaming
  improvements unrelated to this branch)
- Re-add SourceTitleId (TINFO field 24) to fix MakeMKV mkv command title
  selection: the 0-based TINFO index was causing '0' to be passed to
  MakeMKV's mkv command, which MakeMKV interprets as 'rip all titles'
  instead of 'rip title 1'. Now we pass the actual 1-based title number.
- 0-track fallback: retry info scan with normal minLength before falling
  back to RipAllTitles, so a DiscDb-enabled exhaustive scan timeout
  doesn't bypass MainFeature track selection.
- Add MarkStageComplete(Rip) to the 0-track fallback path.
- Add yellow 'Small file' warning on completed movie files under 2GB
  on both the Output list and detail pages.
SourceTitleId (MakeMKV field 24) is the 1-based source title number
on the disc. But MakeMKV's mkv command uses 0-based TINFO indices, so
passing SourceTitleId=1 meant 'rip TINFO index 1' (the second track)
instead of 'rip title 1' (the main feature). This caused every DVD to
rip a short extra instead of the movie.

Fully removed from: Track model, DiscTrack model, MakeMkvModels enum,
GetTrackInfoAsync parsing, FinalizeTrack, CreateTrackObj, and
RipTrackAsync (which now correctly passes trackNumber directly).
…artup

The TranscodeSlotLimiter read MaxConcurrentTranscodes from IOptions<ArmSettings>
once at DI construction time and never updated.  Since the Web UI saves settings
into the DB (not the YAML file), any change via the UI was silently ignored.

The limiter has been rewritten as a dynamic counter+queue gate that accepts the
effective maxConcurrent value from each caller.  FfmpegService and HandBrakeService
now resolve job.Config?.MaxConcurrentTranscodes ?? settings.Value.MaxConcurrentTranscodes
and pass it to AcquireAsync, so UI-driven changes take effect immediately.
@negativeeddy
negativeeddy merged commit a64af9a into master Jul 19, 2026
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.

1 participant