Skip to content

Show the audio track playback starts on in Details - #471

Closed
Kisnov wants to merge 1 commit into
Moonfin-Client:mainfrom
Kisnov:fix/details-audio-matches-player
Closed

Kisnov wants to merge 1 commit into
Moonfin-Client:mainfrom
Kisnov:fix/details-audio-matches-player

Conversation

@Kisnov

@Kisnov Kisnov commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Summary

This takes out the server-default fallback that c6dd29b kept in Details. Since that commit, Details has preselected the series' remembered audio track and otherwise the server's DefaultAudioStreamIndex, while both players take the remembered track (resolveSeriesAudio) and otherwise selectPreferredAudioStream, the picker ported two days earlier in 8eeb0d7. Details now asks that same picker. Kept: the series' remembered track still comes first, and a picker the viewer hasn't touched still sends no index to the player (audioChosenRef), so the player makes its own pick, which is now the one Details shows. Traded: the server's default no longer decides what Details shows, so the Jellyfin profile's Play default audio track stops showing there. The players have ignored it since 8eeb0d7: they only fall back to the server index when the picker returns nothing, and it returns a track for any file with audio. The local Prefer Default Audio Track toggle does that job, and Details now follows it.

The two disagreed whenever the server's pick wasn't the preferences' pick. With Catalan and Spanish set and a Japanese-default episode that also has Spanish, Details showed Japanese and playback started in Spanish. With Play default audio track on in the Jellyfin profile, Details showed the file's default track and playback started in the preferred language. The audio picker, the file information (ModernFileInformation) and the Nouveau footer (NouveauDetailsFooter) all read that selection, so they named a track the player didn't start on. Moonfin-Core's detail screens already use the player's function for this (highlightedAudioIndex in lib/util/detail_track_highlight.dart).

This is separate from #468, which changes the picker's order: Details follows whatever the picker decides. In the #418 setup, main shows Japanese in Details and starts in English; this PR alone shows English, and with #468 both are Japanese. It merges cleanly with each of #460, #468 and #469 (checked with git merge-tree).

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • UI/UX update
  • Documentation update
  • Build/CI change
  • Other (describe):

Changes Made

  • initialAudio.js: initialAudioPosition returns where among the audio tracks the player will start: the series' remembered track, else selectPreferredAudioStream with the settings, the same two steps both players take.
  • playback.js: extractAudioStreams is exported, so Details hands the picker streams in the players' shape. Those carry isDefault and channels, which the picker ranks on and fromServerStream leaves out.
  • useDetailsItem.js: the initial pick uses it in place of the series match and DefaultAudioStreamIndex.
  • Details.js: handleSelectVersion uses it too. It went straight to the new version's DefaultAudioStreamIndex, so switching version also skipped the series' remembered track.
  • initialAudio.test.js: a fallback-language track beats the file's default, and the series' remembered track beats the preferences. Putting the default track ahead of the preferences fails the first, and putting the preferences ahead of the remembered track fails the second.

Subtitles have the same split in Details, but #460 already changes that pick, so I left it alone here.

Platform

  • Tizen (Samsung)
  • webOS (LG)
  • Both / Shared code

Testing

  • Tested on emulator
  • Tested on physical device
  • Manual testing completed
  • Not tested (explain why): not run on a panel yet. @Kisnov has a .wgt built off this branch to check on his Samsung TU43DU7105KXXC (Tizen 9). No LG panel here for webOS.

enact lint packages/app/src clean and npm run lint:css OK. enact test on this branch, off main a8da917e: 2009 passed, 3 failed. The three (personCredits ×2, seerrBadges ×1) hardcode US English date and currency output and fail on this machine's ca-ES locale, unrelated to this change. npm run build:tizen builds, and in the built Details chunk both the initial pick and the version switch call the new helper on extractAudioStreams output, with no DefaultAudioStreamIndex left in Details.

Test Steps

  1. In Settings > Playback & SyncPlay > Audio Preferences, set Default Audio Language to Catalan and Fallback Audio Language to Spanish, and leave Prefer Default Audio Track off.
  2. Open an episode whose default audio track is Japanese and that also has Spanish. Details shows Spanish as the audio track, and pressing Play without touching the picker starts in Spanish.
  3. In a series where you once switched the audio by hand, open another episode. Details shows that track and playback starts on it.
  4. On a title with more than one version, switch version. The audio track Details shows is the one that version starts on.

Screenshots (if applicable)

None attached. The change is which audio track Details names, which a before and after of the audio button or the file information on the step 2 episode would show. Those have to come from @Kisnov's panel, since there's no TV or desktop build here.

Checklist

  • Code builds successfully — npm run build:tizen
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced — enact lint clean

🤖 Generated with Claude Code

Details took the server's DefaultAudioStreamIndex while both players pick
with selectPreferredAudioStream, so the audio picker and the file info
could name a track playback never started on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added Bug Something isn't working Tizen webOS labels Sep 27, 2026
@github-actions

Copy link
Copy Markdown

✅ Build Successful

All platform builds and the test suite passed. You can download the artifacts below.

Platform Status Artifact
webOS ✅ Passed Moonfin_webOS_*.ipk
Tizen Regular ✅ Passed Moonfin_Tizen_Regular_*.wgt
Tizen Oblong ✅ Passed Moonfin_Tizen_Oblong_*.wgt
Tizen Legacy ✅ Passed Moonfin_Tizen_Legacy_*.wgt
Property Value
Commit 3166d93
Workflow run Build #350

@RadicalMuffinMan

Copy link
Copy Markdown
Contributor

PR closed due to not being reviewed by submitter

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

Labels

Bug Something isn't working Tizen webOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants