Skip to content

feat(app): pick a stream's quality in the add sheet - #588

Merged
linroid merged 9 commits into
mainfrom
feat/intake-quality-picker
Oct 18, 2026
Merged

linroid merged 9 commits into
mainfrom
feat/intake-quality-picker

Conversation

@linroid

@linroid linroid commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • The add sheet's preview card for a single HLS master or DASH manifest with several variants now has a Quality section: one radio button per variant (IntakeEntry.variants, best first, such as "1080p · 5.1 Mbps"). The first variant is selected by default.
  • The request sends the chosen variant's ID in selectedFileIds. When the choice is the first variant it sends nothing, so the source picks its own default, the best. A chosen ID the source no longer lists falls back to the first.
  • New intake_quality string, translated into every language. AGENTS.md and docs/media.md now say the quality can be picked in the add sheet, or later in the inspector's Files tab.

Batches and ranges still download the best quality; only the single-link preview offers the choice.

Known limitation: the app can't tell a variant's container before the download starts. If the best variant is fragmented MP4 and the user picks a TS variant, the download fails with the source's "add it again" error, unless the user typed a file name in the sheet.

Snapshots

Before After
Desktop, light
Desktop, dark
Phone, light
Phone, dark

Testing

  • IntakeStateTest: covers the default best variant (empty selection), a chosen variant being sent, re-picking the best, an unlisted ID falling back, and a stream with one variant showing no choice
  • DesignTokenUsageTest, LocalizationResourcesTest, HardcodedTextTest
  • New intake-stream scenario: ./gradlew :app:shared:jvmTest -Psnapshots --tests '*IntakeSheetSnapshots.stream*'

…t AES-128 HLS

- HLS variants and DASH video representations resolve as a single choice
  (FileSelectionMode.SINGLE), best first with video before audio-only; a
  selection made while downloading restarts with that variant
- Separate fragmented MP4 audio (an HLS AUDIO rendition, the main DASH audio
  adaptation set) is merged with the video into one MP4 by rewriting box
  headers, fragments interleaved by start time
- AES-128 HLS segments are decrypted as they arrive with a pure Kotlin
  AES-128-CBC decryptor; SAMPLE-AES and other DRM stay refused
- The add sheet downloads the best variant instead of offering stream
  variants as torrent-style checkboxes
- Real ffmpeg fixtures (DASH with separate tracks, encrypted HLS fMP4 with a
  separate audio rendition) back an end-to-end integration test
…ep boxes before mdat

- Variant IDs are hashes of each variant's manifest identity rather than
  positions, so a refreshed or re-signed manifest cannot map a resumed task's
  chosen ID to another quality
- A variant whose container differs from the output name Ketch chose fails
  instead of writing TS bytes under .mp4; a file destination the user named
  is left alone
- Boxes between a moof and its mdat are kept, as trun data offsets count them
- HLS IVs of any width up to 32 hex digits are left-padded, per RFC 8216
- The preview card of a single HLS master or DASH manifest lists its variants
  (IntakeEntry.variants, best first) as Quality radio buttons, the first checked
- The request names the chosen variant in selectedFileIds, and nothing when it
  is the default, so older devices keep downloading the best
- New intake_quality string in every language; IntakeStateTest and an
  intake-stream snapshot cover it
…icker

# Conflicts:
#	AGENTS.md
#	app/shared/src/commonMain/kotlin/com/linroid/ketch/app/state/IntakeState.kt
#	app/shared/src/commonTest/kotlin/com/linroid/ketch/app/state/IntakeStateTest.kt
#	docs/media.md
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T00:28:13.690009Z 0dd3eab PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 18, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0dd3eab8cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…ly where file selection works and apply them on retry
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 2 116 files   2 144 suites   44m 21s ⏱️
14 589 tests 14 321 ✅ 268 💤 0 ❌
17 736 runs  17 468 ✅ 268 💤 0 ❌

Results for commit dd68348.

@linroid
linroid merged commit 011be2f into main Oct 18, 2026
14 checks passed
@linroid
linroid deleted the feat/intake-quality-picker branch October 18, 2026 01:26
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