feat: auto-remove watched downloads, server watched threshold

close #856
This commit is contained in:
edde746
2026-04-13 22:46:49 +02:00
parent f7e3408c86
commit bc4b4955da
39 changed files with 339 additions and 47 deletions
+14
View File
@@ -47,6 +47,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
static const _kPlayback = 'playback';
static const _kDownloadLocation = 'download_location';
static const _kDownloadOnWifiOnly = 'download_on_wifi_only';
static const _kAutoRemoveWatchedDownloads = 'auto_remove_watched_downloads';
static const _kVideoPlayerControls = 'video_player_controls';
static const _kVideoPlayerNavigation = 'video_player_navigation';
static const _kCrashReporting = 'crash_reporting';
@@ -65,6 +66,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
bool _crashReporting = true;
bool _enableDebugLogging = false;
bool _downloadOnWifiOnly = false;
bool _autoRemoveWatchedDownloads = false;
bool _videoPlayerNavigationEnabled = false;
String? _customRelayUrl;
@@ -121,6 +123,7 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
_crashReporting = _settingsService.getCrashReporting();
_enableDebugLogging = _settingsService.getEnableDebugLogging();
_downloadOnWifiOnly = _settingsService.getDownloadOnWifiOnly();
_autoRemoveWatchedDownloads = _settingsService.getAutoRemoveWatchedDownloads();
_videoPlayerNavigationEnabled = _settingsService.getVideoPlayerNavigationEnabled();
_customRelayUrl = _settingsService.getCustomRelayUrl();
_isLoading = false;
@@ -249,6 +252,17 @@ class _SettingsScreenState extends State<SettingsScreen> with FocusableTab {
await _settingsService.setDownloadOnWifiOnly(value);
},
),
SwitchListTile(
focusNode: _focusTracker.get(_kAutoRemoveWatchedDownloads),
secondary: const AppIcon(Symbols.delete_sweep_rounded, fill: 1),
title: Text(t.settings.autoRemoveWatchedDownloads),
subtitle: Text(t.settings.autoRemoveWatchedDownloadsDescription),
value: _autoRemoveWatchedDownloads,
onChanged: (value) async {
setState(() => _autoRemoveWatchedDownloads = value);
await _settingsService.setAutoRemoveWatchedDownloads(value);
},
),
],
);
}