Skip to content

feat: add toggle for trailer banner audio - #110

Closed
EierKopZA wants to merge 3 commits into
ProdigyV21:mainfrom
EierKopZA:feature/trailer-sound-setting
Closed

feat: add toggle for trailer banner audio#110
EierKopZA wants to merge 3 commits into
ProdigyV21:mainfrom
EierKopZA:feature/trailer-sound-setting

Conversation

@EierKopZA

Copy link
Copy Markdown
Contributor

This PR introduces a new user preference that allows users to toggle the audio for trailers playing in the Home Screen Hero Banner.

By default, trailers will remain muted to ensure a non-intrusive experience, but users can now choose to enable sound via the settings menu.

Key Changes:

New Preference: Added trailer_audio_enabled to the local DataStore. This setting is profile-specific.
Settings UI: Added a new "Trailer Audio" toggle in the General Settings > Playback section.
Audio Control: Updated the TrailerPlayer component to support an isMuted parameter. When unmuted, the trailer plays at a comfortable 50% volume (0.5f).
State Propagation: Updated HomeViewModel to load the current audio preference and pass it through to the TrailerPlayer on the Home screen.
Files Modified:

SettingsViewModel.kt: Added logic to manage and persist the new setting.
SettingsScreen.kt: Added the toggle UI row and updated the GeneralSettings layout.
HomeViewModel.kt: Updated to load the setting for the home screen UI state.
HomeScreen.kt: Passes the user's preference down to the banner player.
TrailerPlayer.kt: Added support for muting/unmuting the background video.

@Himanth-reddy Himanth-reddy self-assigned this Apr 3, 2026

@Himanth-reddy Himanth-reddy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great feature! The trailer audio toggle logic is clean and well-integrated. Two quick fixes needed before merge:

1. Focus Index Collision (Critical)

The "Trailer Audio" toggle at focusedIndex == 9 collides with "Match Frame Rate" (also == 9), making the audio toggle unreachable via D-pad.

  • Update "Match Frame Rate" to focusedIndex == 10
  • Increment all subsequent items: Card Layout → 11, UI Mode → 12, Skip Profile Selection → 13, DNS Provider → 14
  • Update max index comment: 0 -> 13 // General: 14 items0 -> 14 // General: 15 items (two locations in SettingsScreen.kt)

2. Trailer Aspect Ratio

Change TrailerPlayer.kt resizeMode from RESIZE_MODE_ZOOM to RESIZE_MODE_FILL so the trailer crops to fill the entire TV screen without letterboxing.

Summary

Everything else looks solid—audio state propagation is correct, DataStore persistence is safe, and the default (muted) behavior is user-friendly.

@EierKopZA

Copy link
Copy Markdown
Contributor Author

@Himanth-reddy done

@Himanth-reddy

Copy link
Copy Markdown
Collaborator

Thanks for the update. I took another pass through the changes and wanted to leave a full review here instead of the shorter earlier note.

There was some confusion on my side around the trailer sizing behavior. So there is no issue there and no resize-mode change is needed in this PR. So Change the resize mode back to zoom

The remaining issues I’m seeing are:

1. General settings navigation still stops too early

The General section now includes the new Trailer Audio row and shifts the later items down, but the D-pad navigation limit still stops before the final DNS Provider row. As a result, DNS Provider is not reachable through normal remote navigation.

2. Trailer audio preference is not scoped to the active profile

The new setting is stored as a profile-scoped preference, but the Home screen loads it by checking whether any saved preference key ends with _trailer_audio_enabled. That means if one profile enables trailer audio, another profile can also end up reading it as enabled. The value should be loaded for the active profile only.

3. Trailer audio is not included in cloud sync / restore

setTrailerAudioEnabled() triggers cloud sync, but the new setting is not part of the cloud profile snapshot or restore path. So it looks persisted from the UI, but it will not survive sync/restore between devices the way the surrounding playback settings do.

Scope

I’m also noticing that this branch contains additional settings-related changes beyond the trailer audio feature itself. Since the core trailer-audio feature is small and the extra settings work makes the diff harder to review, I’d recommend keeping this PR focused on the trailer audio toggle and moving the unrelated settings changes into a new pull request.

But I still checked the trailer cropping, it still does not fill the entire screen. If you can, make a new pull request with this update.

Once the navigation limit, active-profile loading, and sync coverage are fixed, this should be in much better shape.

@EierKopZA
EierKopZA force-pushed the feature/trailer-sound-setting branch from 0dd5974 to b0ab5eb Compare April 3, 2026 11:40
@ProdigyV21

Copy link
Copy Markdown
Owner

Thanks for this feature — the trailer audio toggle logic itself is clean and the default-muted behavior is a good choice. This PR is still in CHANGES_REQUESTED state from @Himanth-reddy's review, and the blocking issues haven't been resolved yet. Summarizing what's still needed before merge:

1. D-pad navigation limit still stops too early
The General section now includes the new Trailer Audio row and shifts the later items down, but the D-pad navigation limit still stops before the final DNS Provider row. As a result, DNS Provider is not reachable through normal remote navigation. Please update the max-index clamp in GeneralSettings to match the new row count. (This is the same recurring issue as #112 / #109 — any new settings row needs both the focus index remap and the clamp bump.)

2. Trailer audio preference is not correctly scoped to the active profile
The setting is stored as a profile-scoped preference, but HomeViewModel loads it by checking whether any saved preference key ends in _trailer_audio_enabled. That means if one profile enables trailer audio, every other profile will also read it as enabled. Please load the value for the active profile only (use the standard profileManager.profileBooleanKey(...) path used by the surrounding settings).

3. Not included in cloud sync / restore
setTrailerAudioEnabled() triggers cloud sync, but the new setting is not part of the cloud profile snapshot or the restore path. So it looks persisted from the UI, but it won't survive sync/restore between devices the way the surrounding playback settings do. Please add it to CloudSyncRepository snapshot and restore alongside the other playback prefs.

4. Scope creep
This branch contains additional settings-related changes beyond the trailer audio feature itself. To make review easier and reduce the risk surface of each merge, please either:

  • move the unrelated settings changes into a separate PR, or
  • explicitly list them in the description so reviewers know what extra ground to cover.

The trailer cropping / resizeMode point from the earlier review has been clarified — no change needed there in this PR (per Himanth's follow-up comment on 2026-04-03).

Once 1–4 are addressed, this is ready to merge.

ProdigyV21 pushed a commit that referenced this pull request Apr 5, 2026
The movie budget line on the home hero banner makes the metadata row
noisy, particularly on small screens where it pushes release date,
runtime, and rating onto a second line. This adds a new Settings toggle
(General > Show Budget on Home, default ON) so users who don't care
about movie budgets can hide the field without losing the rest of the
hero metadata.

Scope of this feature was one of the multi-part requests in #72.

Changes:

- HomeUiState: new `showBudget: Boolean = true` field.
- HomeViewModel.init: loads the new `_show_budget_on_home` key from
  DataStore alongside the existing trailer_auto_play load, with a
  default of true so existing users see no change until they explicitly
  disable it.
- HomeScreen: wraps the existing "Budget $budgetText" Text (and its
  preceding `|` separator) in `if (uiState.showBudget && ...)`. No other
  visual changes.
- SettingsUiState: new `showBudget: Boolean = true` field.
- SettingsViewModel: new `showBudgetKey()` helper, loaded into UI state,
  and `setShowBudget(enabled)` mutator that persists + triggers cloud
  sync (matches the trailerAutoPlay pattern exactly).
- SettingsScreen: new `SettingsToggleRow` for "Show Budget on Home"
  inserted at focusedIndex == 13 (immediately after "Skip Profile
  Selection" and before the Network section). DNS Provider shifted from
  focusedIndex == 13 to focusedIndex == 14, and the max-index clamp in
  BOTH the auto-scroll LaunchedEffect and the D-pad-down handler bumped
  from 13 to 14 so DNS Provider remains reachable via remote navigation.
  The Enter-handler switch now maps 13 -> setShowBudget and 14 ->
  openDnsProviderPicker. This is the recurring "settings row focus
  index" footgun that burned PRs #110 and #112 previously \u2014 I've
  updated both the dynamic max-index AND the scroll auto-scroll max
  AND the per-index action switch in the same commit.
- CloudSyncRepository: adds `showBudget` to the `CloudProfileSettings`
  data class, `showBudgetKeyFor(profileId)` helper, and push/pull
  wiring so the setting syncs across devices via the existing
  account_sync_state snapshot path (the same plumbing that handles
  trailer_auto_play).

Closes #72 (Show Budget part). The other two parts of #72 (auto-hide
top bar, native debrid manager) are scoped separately as larger
features and are not in this PR.
ProdigyV21 added a commit that referenced this pull request Apr 5, 2026
* feat: Show Budget on Home toggle in Settings (#72)

The movie budget line on the home hero banner makes the metadata row
noisy, particularly on small screens where it pushes release date,
runtime, and rating onto a second line. This adds a new Settings toggle
(General > Show Budget on Home, default ON) so users who don't care
about movie budgets can hide the field without losing the rest of the
hero metadata.

Scope of this feature was one of the multi-part requests in #72.

Changes:

- HomeUiState: new `showBudget: Boolean = true` field.
- HomeViewModel.init: loads the new `_show_budget_on_home` key from
  DataStore alongside the existing trailer_auto_play load, with a
  default of true so existing users see no change until they explicitly
  disable it.
- HomeScreen: wraps the existing "Budget $budgetText" Text (and its
  preceding `|` separator) in `if (uiState.showBudget && ...)`. No other
  visual changes.
- SettingsUiState: new `showBudget: Boolean = true` field.
- SettingsViewModel: new `showBudgetKey()` helper, loaded into UI state,
  and `setShowBudget(enabled)` mutator that persists + triggers cloud
  sync (matches the trailerAutoPlay pattern exactly).
- SettingsScreen: new `SettingsToggleRow` for "Show Budget on Home"
  inserted at focusedIndex == 13 (immediately after "Skip Profile
  Selection" and before the Network section). DNS Provider shifted from
  focusedIndex == 13 to focusedIndex == 14, and the max-index clamp in
  BOTH the auto-scroll LaunchedEffect and the D-pad-down handler bumped
  from 13 to 14 so DNS Provider remains reachable via remote navigation.
  The Enter-handler switch now maps 13 -> setShowBudget and 14 ->
  openDnsProviderPicker. This is the recurring "settings row focus
  index" footgun that burned PRs #110 and #112 previously \u2014 I've
  updated both the dynamic max-index AND the scroll auto-scroll max
  AND the per-index action switch in the same commit.
- CloudSyncRepository: adds `showBudget` to the `CloudProfileSettings`
  data class, `showBudgetKeyFor(profileId)` helper, and push/pull
  wiring so the setting syncs across devices via the existing
  account_sync_state snapshot path (the same plumbing that handles
  trailer_auto_play).

Closes #72 (Show Budget part). The other two parts of #72 (auto-hide
top bar, native debrid manager) are scoped separately as larger
features and are not in this PR.

* fix: pass showBudget through to HeroSection composable (scope fix)

* fix: thread showBudget through HomeHeroLayer too (second scope fix)

---------

Co-authored-by: Arvin <arvin@arflix.local>
@EierKopZA EierKopZA closed this May 5, 2026
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.

3 participants