1
0
mirror of https://github.com/yattee/yattee.git synced 2025-04-28 07:50:33 +05:30

Minor fixes

This commit is contained in:
Arkadiusz Fal 2022-11-17 22:49:08 +01:00
parent fa15a18374
commit 3b01fe34c3
3 changed files with 17 additions and 12 deletions

View File

@ -76,7 +76,7 @@ struct URLBookmarkModel {
} }
func refreshAll() { func refreshAll() {
logger.info("refreshing all bookamrks") logger.info("refreshing all bookmarks")
allURLs.forEach { url in allURLs.forEach { url in
if loadBookmark(url) != nil { if loadBookmark(url) != nil {

View File

@ -26,7 +26,7 @@ struct ControlsOverlay: View {
var body: some View { var body: some View {
ScrollView { ScrollView {
VStack { VStack {
Section(header: controlsHeader("Rate & Captions".localized())) { Section(header: controlsHeader(rateAndCaptionsLabel.localized())) {
HStack(spacing: rateButtonsSpacing) { HStack(spacing: rateButtonsSpacing) {
decreaseRateButton decreaseRateButton
#if os(tvOS) #if os(tvOS)
@ -39,15 +39,16 @@ struct ControlsOverlay: View {
#endif #endif
} }
captionsButton if player.activeBackend == .mpv {
#if os(tvOS) captionsButton
.focused($focusedField, equals: .captions) #if os(tvOS)
#endif .focused($focusedField, equals: .captions)
.disabled(player.activeBackend != .mpv) #endif
#if os(iOS) #if os(iOS)
.foregroundColor(.white) .foregroundColor(.white)
#endif #endif
}
} }
Section(header: controlsHeader("Quality Profile".localized())) { Section(header: controlsHeader("Quality Profile".localized())) {
@ -110,6 +111,10 @@ struct ControlsOverlay: View {
#endif #endif
} }
private var rateAndCaptionsLabel: String {
player.activeBackend == .mpv ? "Rate & Captions" : "Playback Rate"
}
private var overlayHeight: Double { private var overlayHeight: Double {
#if os(tvOS) #if os(tvOS)
contentSize.height + 80.0 contentSize.height + 80.0

View File

@ -23,19 +23,19 @@ struct TVNavigationView: View {
.tabItem { Text("Subscriptions") } .tabItem { Text("Subscriptions") }
.tag(TabSelection.subscriptions) .tag(TabSelection.subscriptions)
} }
if visibleSections.contains(.popular), accounts.app.supportsPopular { if visibleSections.contains(.popular), accounts.app.supportsPopular {
LazyView(PopularView()) LazyView(PopularView())
.tabItem { Text("Popular") } .tabItem { Text("Popular") }
.tag(TabSelection.popular) .tag(TabSelection.popular)
} }
if visibleSections.contains(.trending) { if visibleSections.contains(.trending) {
LazyView(TrendingView()) LazyView(TrendingView())
.tabItem { Text("Trending") } .tabItem { Text("Trending") }
.tag(TabSelection.trending) .tag(TabSelection.trending)
} }
if visibleSections.contains(.playlists), accounts.app.supportsUserPlaylists, accounts.signedIn { if visibleSections.contains(.playlists), accounts.app.supportsUserPlaylists, accounts.signedIn {
LazyView(PlaylistsView()) LazyView(PlaylistsView())
.tabItem { Text("Playlists") } .tabItem { Text("Playlists") }