Skip to content

fix(scanner): read Ogg and Opus audiobook tags from the audio stream - #3165

Merged
Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/1253-ogg-opus-audiobook-tags
Oct 27, 2026
Merged

Quick104 merged 1 commit into
Silo-Server:mainfrom
Rhainland:fix/1253-ogg-opus-audiobook-tags

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1253
Validation tasks: unblocks #1254 C2; unblocks #1256 C2 and C11

Audiobooks stored as Ogg Vorbis (.ogg) or Opus (.opus) lose all of their tags. They show no author or narrator, no year, summary, series or genres, and can't be found by author or narrator. Only the title survives, because it falls back to the folder name.

The scanner reads book metadata from ffprobe's container-level tags (format.tags). Ogg keeps its Vorbis comments on the audio stream instead, so for these files format.tags is empty. This change reads them from there.

Approach

When the container is Ogg, FormatTags takes any key it is missing from the first audio stream's tags, normalised the same way. Container tags still win when both have a key, and cover-art streams are skipped. The fallback is limited to Ogg on purpose: in MP4 the audio stream carries tags such as language=und and handler_name, which would otherwise leak into book metadata.

The podcast scanner is the only other reader of FormatTags, so Ogg and Opus podcast episodes also get their file tags now. Chapters were already read correctly from Ogg files.

Books already in a library are re-read only when their files change, or while they are still unmatched. The unchanged-folder check skips the rest, so an Ogg/Opus book that was already matched keeps its missing credits until its files change.

Validation

  • go test ./internal/scanner/...: pass. The new test feeds Ogg- and MP4-shaped ffprobe output through the probe parser; it fails without the fix.
  • Full gate on an integration build of this branch together with the other Audiobooks #1253 fixes: see the summary on Audiobooks #1253.
  • Runtime: on a local build with a synthetic Opus book (author Zoë Ångström, narrator Søren Ølgaard) and an Ogg Vorbis book, a fresh scan now stores both credits and the year. In the web app the Opus author appears under People in search and in the library's Authors view. Before, both books had no credits.

Evidence

Before After
Opus book: no author, no narrator, year 0 Zoë Ångström (author), Søren Ølgaard (narrator), 2018
Ogg book: no author Evan Pryce (author)

Surface and build: catalog data after a fresh scan of the same synthetic files; before on e6df1d8ed, after on this branch. Web search for "Ångström" in the Audiobooks scope returns the author under People only after the change.

Risks

None identified. Only files in an Ogg container take the new path.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code (T3 Code)
  • Tool(s): Claude Code, Codex CLI, GitHub CLI, Playwright, Docker, ffmpeg
  • Model(s): claude-opus-5-5; gpt-6.1-sol (review)
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: Independent Claude Opus 5.5 and GPT 6.1 Sol reviews of the branch diff (correctness, repo standards, the bug as described). GPT found nothing. Opus noted that books already matched aren't re-read until their files change; that is stated above rather than changed, because forcing a re-read is a separate decision about the unchanged-folder check.

Note

Fix Ogg/Opus audiobook tag reading to use audio stream tags

Ogg files often store metadata on the audio stream rather than the container. A new formatTags helper in probe.go fills missing keys from the first audio stream for Ogg files only; format-level tags take precedence, and non-audio streams are skipped. Other containers keep using container-level tags only. Adds tests in probe_container_test.go covering stream tag fallback, precedence, and non-Ogg behavior.

  • Behavioral Change: Ogg probe output can now include tags sourced from the audio stream that were previously missing.

Macroscope summarized 174b6cb.

Ogg stores Vorbis comments per stream, so ffprobe reports an Ogg Vorbis
or Opus file's title, artist, narrator and date on the audio stream and
leaves format.tags empty. The audiobook and podcast scanners read only
format tags, so those books lost their author, narrator, year,
description, series and genres, keeping only a filesystem-derived title.

For Ogg containers, fill the keys format tags lack from the first audio
stream's tags. Other containers are unchanged: their stream tags
(language, handler_name) describe the track, not the file.
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Oct 27, 2026
@silo-kody

silo-kody Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f271f08c-64b6-4276-87fe-8fc1fc84441a
Commits

Reviewing files that changed from the base of the PR and between 62b1a6e and 174b6cb.

Files selected for processing: 2
  • internal/scanner/probe.go
  • internal/scanner/probe_container_test.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

Ogg tag conversion now fills missing format tags from the first audio stream. Format tags take precedence, and non-Ogg containers do not use audio-stream tags as a fallback.

Changes: Ogg tag fallback

Layer / File(s) Summary
Ogg tag fallback and coverage
internal/scanner/probe.go, internal/scanner/probe_container_test.go
convertProbeData supplements missing Ogg format tags with tags from the first audio stream. Existing format tags take precedence, and non-Ogg containers use only format tags. Tests cover these cases. detectContainer uses the containerOgg constant.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: bug, go, impact: usability, size/L, needs-review

Suggested reviewers: quick104

Merge Risk: Minimal · up to 174b6

No actionable merge-blocking issue remains. The Ogg metadata fallback is ready to merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: reading Ogg and Opus audiobook tags from audio streams.
Description check Passed The description is directly related to the changeset. It explains the metadata problem, the Ogg-specific fallback, precedence rules, tests, validation, and known re-scan behavior.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 2 files.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@silo-triage silo-triage Bot added bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish labels Oct 27, 2026
@silo-triage

silo-triage Bot commented Oct 27, 2026

Copy link
Copy Markdown

The Evidence table describes the results but does not show the changed views. Please add before-and-after captures of Authors and People search using the same synthetic Ogg/Opus books, identify each build, and include desktop and phone-width web captures (or explain why mobile is unaffected).

@macroscopeapp

macroscopeapp Bot commented Oct 27, 2026

Copy link
Copy Markdown

This change is visible: Ogg/Opus stream tags add book credits and year, affecting Authors browsing and People search. The Evidence table describes the results but does not show them. Please add before-and-after captures of the same Authors view and People search with the same test books/query, identifying the surface and build; include desktop and phone-width web captures for both where those screens show the change.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@coderabbitai coderabbitai Bot added impact: usability Core flow broken or severely blocked needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. size/L 200–499 added + deleted lines (all files); change volume, not priority. labels Oct 27, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 27, 2026

Copy link
Copy Markdown

The Validation tasks: line labels #1254 C2 and #1256 C2/C11 as unblocks, but their Results cells are Not run; there is no failed or blocked result to unblock. For the validation records reviewed, please use:

Validation tasks: none

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working evidence-required Needs before-and-after evidence before the Evidence check passes go Pull requests that update go code impact: usability Core flow broken or severely blocked needs-review Needs maintainer review to resolve uncertain classification, scope, or changed evidence. priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants