Skip to content

fix(playback): honor device audio language during server track selection #595

Closed

Description

@Quick104

Problem

Apple stores the Audio Language picker as the canonical playback.audio_language key at profile_device, matching the current Settings copy ("for this device") and the settings contract. The server contract resolves this key in this order:

profile_series → profile_library → profile_device → profile → default

However, the server paths that choose the initial audio track omit the request device ID:

  • Playback V3 preferredAudioTrackIndexV3 calls resolvedProfileAudioLanguage, which constructs settingsresolve.Context{ProfileID: ...}.
  • Catalog detail's audioPrefResolver constructs profile/library/series contexts but no DeviceID.

settingsresolve deliberately excludes profile_device candidates when DeviceID is empty. Apple does not apply PlayerSettings.audioLanguage inside its native player; it trusts the server-selected track. The visible Apple setting therefore persists but does not affect initial playback.

Android currently masks this server gap by applying its local player setting directly.

Expected behavior

When no explicit audio track identity is requested, server-selected audio must honor the canonical contract for the requesting device:

  1. series choice
  2. library preference
  3. profile-device override
  4. roaming profile default
  5. media/container default

An explicit requested track must continue to win.

Proposed implementation

  • Carry the stable X-Silo-Device-Id request identity into canonical audio-language resolution for catalog detail and Playback V3 start.
  • Use the existing settingsresolve.Context and contract precedence instead of adding another settings path.
  • Preserve fallback behavior when a request has no device ID.
  • Keep concrete per-series track identity semantics unchanged.

Acceptance criteria

  • A profile_device playback.audio_language row changes the audio track selected by Playback V3 for that device.
  • The catalog's effective_audio_track_index / effective_audio_language agree with Playback V3 for the same device and content.
  • Series and library choices continue to outrank the device override.
  • A profile default is used when no narrower override exists.
  • An explicit track request still wins.
  • A request without X-Silo-Device-Id retains the current profile/library/series fallback behavior.
  • Focused tests cover device isolation and the full relevant precedence.

Context

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions