Skip to content

Merge multi-part M4B downloads into a single file - #91

Draft
benjitobz wants to merge 3 commits into
Chaptarr:developfrom
benjitobz:multipart-m4b-merge
Draft

Merge multi-part M4B downloads into a single file#91
benjitobz wants to merge 3 commits into
Chaptarr:developfrom
benjitobz:multipart-m4b-merge

Conversation

@benjitobz

Copy link
Copy Markdown

Description

Multi-part downloads that already consist of M4B files were the one case the M4B conversion pipeline did not create 1 m4b file. There was a guard in ImportApprovedBooks which skipped conversion entirely, so a 10-part M4B audiobook imported as 10 separate files while multi-part MP3/M4A/FLAC merged into one. This was obviously intentional but for some setups a single m4b file works better.

This adds an opt-in per-quality-profile setting, MergeMultiPartFiles, exposed as a "Create Single File" checkbox below Convert To in the quality profile editor. When enabled, multi-part all-M4B downloads are routed through the existing m4b-tool merge pipeline like any other format.

  • Single-file M4B downloads are still imported untouched to avoid a pointless re-encode.
  • GetPlannedConversionTarget is unchanged, so queue display and decision-engine effective-quality comparisons behave exactly as before; the new ShouldMergeMultiPartM4b helper gates the import path only.
  • The flag round-trips through the API resource, openapi.json, and settings backups.

Database Migration

YES.
Migration 103 adds a MergeMultiPartFiles boolean column (NOT NULL, default false) to QualityProfiles, with an existence check Migration 001 complete-schema migration gains the same column for fresh installs.

How was this tested?

Built with docker build -f Dockerfile.build on Ubuntu and deployed over a live SQLite install (v0.9.936.0) that previously ran the base branch. Verified on startup:

  • Migration 103 applied cleanly to the existing database and the app started without errors.
  • GET /api/v1/qualityprofile returns mergeMultiPartFiles on existing profiles (defaulting to false).
  • The checkbox renders and persists in the profile editor.

Screenshots (UI changes only)

image

@benjitobz
benjitobz force-pushed the multipart-m4b-merge branch from 01d348f to 6c3ab7b Compare August 27, 2026 19:04
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