Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Zapp/Settings/disableDownloads.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Foundation

enum FeatureFlags {
static var disableDownloads: Bool = true
}
18 changes: 10 additions & 8 deletions Zapp/Views/MediathekDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,19 @@ struct MediathekDetailView: View {
}
.buttonStyle(.bordered)

Menu {
ForEach(show.supportedQualities, id: \.self) { quality in
Button(action: { startDownload(quality: quality) }) {
Label(quality.localizedName, systemImage: "arrow.down.circle")
if !FeatureFlags.disableDownloads {
Menu {
ForEach(show.supportedQualities, id: \.self) { quality in
Button(action: { startDownload(quality: quality) }) {
Label(quality.localizedName, systemImage: "arrow.down.circle")
}
}
} label: {
Label("show_download", systemImage: "arrow.down.circle")
.frame(maxWidth: .infinity)
}
} label: {
Label("show_download", systemImage: "arrow.down.circle")
.frame(maxWidth: .infinity)
.buttonStyle(.bordered)
}
.buttonStyle(.bordered)
}

if let websiteUrl = show.websiteUrl {
Expand Down
16 changes: 12 additions & 4 deletions Zapp/Views/PersonalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ struct PersonalView: View {
Picker("", selection: $selectedTab) {
Text("personal_continue_watching").tag(0)
Text("personal_bookmarks").tag(1)
Text("personal_downloads").tag(2)
if !FeatureFlags.disableDownloads {
Text("personal_downloads").tag(2)
}
}
.pickerStyle(SegmentedPickerStyle())
.padding(.horizontal, usesCenteredLayout ? 24 : 8)
Expand All @@ -27,16 +29,22 @@ struct PersonalView: View {
BookmarksListView()
.tag(1)

DownloadsListView()
.tag(2)
if !FeatureFlags.disableDownloads {
DownloadsListView()
.tag(2)
}
}
.tabViewStyle(PageTabViewStyle(indexDisplayMode: .never))
.padding(.horizontal, usesCenteredLayout ? 12 : 0)
}
.frame(maxWidth: usesCenteredLayout ? 900 : .infinity)
.frame(maxWidth: .infinity)
.onReceive(NotificationCenter.default.publisher(for: .navigateToDownloadsTab)) { _ in
selectedTab = 2
if !FeatureFlags.disableDownloads {
selectedTab = 2
} else {
selectedTab = 1
}
}
.navigationTitle(Text("tab_personal"))
}
Expand Down
30 changes: 16 additions & 14 deletions Zapp/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,24 @@ struct SettingsView: View {

private var storageSection: some View {
Section(String(localized: "settings_storage_section")) {
Toggle(isOn: $settings.downloadOverWifiOnly) {
SettingsRowLabel(
title: String(localized: "settings_download_wifi_only_title"),
description: String(localized: "settings_download_wifi_only_description")
)
}
if !FeatureFlags.disableDownloads {
Toggle(isOn: $settings.downloadOverWifiOnly) {
SettingsRowLabel(
title: String(localized: "settings_download_wifi_only_title"),
description: String(localized: "settings_download_wifi_only_description")
)
}

Button(role: .destructive) {
pendingDestructiveAction = .deleteDownloads(count: repo.downloads.count)
} label: {
SettingsRowLabel(
title: String(localized: "settings_delete_downloads_title"),
description: downloadDeletionDescription
)
Button(role: .destructive) {
pendingDestructiveAction = .deleteDownloads(count: repo.downloads.count)
} label: {
SettingsRowLabel(
title: String(localized: "settings_delete_downloads_title"),
description: downloadDeletionDescription
)
}
.disabled(repo.downloads.isEmpty)
}
.disabled(repo.downloads.isEmpty)

Button(role: .destructive) {
pendingDestructiveAction = .clearCache
Expand Down