Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Ask before clearing the logs, and keep the auto-download series default on the device it was set on

Barnabasc46eff806480
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index 1e0a8898..fb75efdd 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -1004,6 +1004,8 @@
},
"clearLogs": "Clear logs",
"logsCleared": "Logs cleared",
+ "clearLogsQuestion": "Clear logs?",
+ "clearLogsContent": "This can't be undone. Send them first if you might want them.",
"sectionAdvanced": "Advanced",
"localServer": "Local server",
"localServerInfoTitle": "Local Server",
diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart
index 88bf0eb8..8b793a90 100644
--- a/lib/l10n/app_localizations.dart
+++ b/lib/l10n/app_localizations.dart
@@ -3874,6 +3874,18 @@ abstract class AppLocalizations {
/// **'Logs cleared'**
String get logsCleared;
+ /// No description provided for @clearLogsQuestion.
+ ///
+ /// In en, this message translates to:
+ /// **'Clear logs?'**
+ String get clearLogsQuestion;
+
+ /// No description provided for @clearLogsContent.
+ ///
+ /// In en, this message translates to:
+ /// **'This can\'t be undone. Send them first if you might want them.'**
+ String get clearLogsContent;
+
/// No description provided for @sectionAdvanced.
///
/// In en, this message translates to:
diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart
index 9505331e..18dfd29f 100644
--- a/lib/l10n/app_localizations_de.dart
+++ b/lib/l10n/app_localizations_de.dart
@@ -2112,6 +2112,13 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get logsCleared => 'Logs gelöscht';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Erweitert';
diff --git a/lib/l10n/app_localizations_el.dart b/lib/l10n/app_localizations_el.dart
index 79de71aa..f0c5badc 100644
--- a/lib/l10n/app_localizations_el.dart
+++ b/lib/l10n/app_localizations_el.dart
@@ -2088,6 +2088,13 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get logsCleared => 'Logs cleared';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Advanced';
diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart
index 8372810b..6740cdaa 100644
--- a/lib/l10n/app_localizations_en.dart
+++ b/lib/l10n/app_localizations_en.dart
@@ -2088,6 +2088,13 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get logsCleared => 'Logs cleared';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Advanced';
diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart
index 85722063..d597739b 100644
--- a/lib/l10n/app_localizations_es.dart
+++ b/lib/l10n/app_localizations_es.dart
@@ -2090,6 +2090,13 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get logsCleared => 'Logs cleared';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Advanced';
diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart
index 884695cf..dc7b1fb2 100644
--- a/lib/l10n/app_localizations_fr.dart
+++ b/lib/l10n/app_localizations_fr.dart
@@ -2124,6 +2124,13 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get logsCleared => 'Journaux effacés';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Avancé';
diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart
index c80142be..04ee2754 100644
--- a/lib/l10n/app_localizations_it.dart
+++ b/lib/l10n/app_localizations_it.dart
@@ -2088,6 +2088,13 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get logsCleared => 'Logs cleared';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Advanced';
diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart
index a963c8eb..1ca65228 100644
--- a/lib/l10n/app_localizations_ja.dart
+++ b/lib/l10n/app_localizations_ja.dart
@@ -2088,6 +2088,13 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get logsCleared => 'Logs cleared';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Advanced';
diff --git a/lib/l10n/app_localizations_no.dart b/lib/l10n/app_localizations_no.dart
index c277732a..9c187e04 100644
--- a/lib/l10n/app_localizations_no.dart
+++ b/lib/l10n/app_localizations_no.dart
@@ -2088,6 +2088,13 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get logsCleared => 'Logs cleared';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Advanced';
diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart
index 5e3d5249..868436fc 100644
--- a/lib/l10n/app_localizations_pt.dart
+++ b/lib/l10n/app_localizations_pt.dart
@@ -2088,6 +2088,13 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get logsCleared => 'Logs cleared';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Advanced';
diff --git a/lib/l10n/app_localizations_ro.dart b/lib/l10n/app_localizations_ro.dart
index 71d5a917..ddcb63f3 100644
--- a/lib/l10n/app_localizations_ro.dart
+++ b/lib/l10n/app_localizations_ro.dart
@@ -2088,6 +2088,13 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get logsCleared => 'Logs cleared';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Advanced';
diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart
index ce3aa831..54fa68c1 100644
--- a/lib/l10n/app_localizations_ru.dart
+++ b/lib/l10n/app_localizations_ru.dart
@@ -2092,6 +2092,13 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get logsCleared => 'Logs cleared';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => 'Расширенные';
diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart
index 79381b88..7419cb9e 100644
--- a/lib/l10n/app_localizations_zh.dart
+++ b/lib/l10n/app_localizations_zh.dart
@@ -2044,6 +2044,13 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get logsCleared => '日志已清除';
+ @override
+ String get clearLogsQuestion => 'Clear logs?';
+
+ @override
+ String get clearLogsContent =>
+ 'This can\'t be undone. Send them first if you might want them.';
+
@override
String get sectionAdvanced => '高级';
diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart
index c4057d75..ac7d5a0f 100644
--- a/lib/screens/settings_screen.dart
+++ b/lib/screens/settings_screen.dart
@@ -3920,6 +3920,18 @@ class _SettingsScreenState extends State<SettingsScreen> {
leading: Icon(Icons.delete_outline_rounded, color: cs.error),
title: Text(l.clearLogs),
onTap: () async {
+ final confirmed = await showDialog<bool>(
+ context: context,
+ builder: (ctx) => AlertDialog(
+ title: Text(l.clearLogsQuestion),
+ content: Text(l.clearLogsContent),
+ actions: [
+ TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text(l.cancel)),
+ TextButton(onPressed: () => Navigator.pop(ctx, true), child: Text(l.clear)),
+ ],
+ ),
+ );
+ if (confirmed != true || !mounted) return;
await LogService().clearLogs();
if (mounted) {
showOverlayToast(context, l.logsCleared,
diff --git a/lib/services/settings_sync_service.dart b/lib/services/settings_sync_service.dart
index 704d9e06..8beac694 100644
--- a/lib/services/settings_sync_service.dart
+++ b/lib/services/settings_sync_service.dart
@@ -152,6 +152,7 @@ class SettingsSyncService {
'trustAllCerts',
'queueAutoDownload',
'autoDownloadOnStream',
+ 'autoSeriesDownloadDefault',
'rollingDownloadCount',
'rollingDownloadDeleteFinished',
};