A cross platform Audiobookshelf client for Android and iOS
Dart
Add a delete option for accounts with delete permission, with the choice to delete the files too
Barnabas7cdead03d7c7
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arbindex ce023a55..a1f3cfc6 100644--- a/lib/l10n/app_en.arb+++ b/lib/l10n/app_en.arb@@ -1639,6 +1639,28 @@"deleteCollectionContent": "Are you sure you want to delete this collection?","deleteCollectionFailed": "Couldn't delete the collection","deletePermissionRequired": "Delete permission required. Ask the root admin to grant you the delete permission.",+ "deleteFilesCheckbox": "Also delete the files on the server",+ "deleteFilesCheckedHint": "The files are deleted from the server for good.",+ "deleteFilesUncheckedHint": "The files stay on the server, so the next library scan can add this back.",+ "deleteFromServerAction": "Delete from Server",+ "deleteFromServerTitle": "Delete from server",+ "deleteFromServerContent": "Delete \"{title}\" from Audiobookshelf?",+ "@deleteFromServerContent": {+ "placeholders": {+ "title": {+ "type": "String"+ }+ }+ },+ "deletedFromServer": "Deleted \"{title}\"",+ "@deletedFromServer": {+ "placeholders": {+ "title": {+ "type": "String"+ }+ }+ },+ "deleteFromServerFailed": "Couldn't delete that. Check the server logs.","playlistNotFound": "Playlist not found","deletePlaylist": "Delete Playlist","deletePlaylistContent": "Are you sure you want to delete this playlist?",@@ -2159,7 +2181,7 @@"adminMissingBadge": "Missing","adminInvalidBadge": "Invalid","adminMissingDeleteTitle": "Remove entry",- "adminMissingDeleteOneContent": "Remove \"{title}\" from Audiobookshelf? The files on disk are not deleted.",+ "adminMissingDeleteOneContent": "Remove \"{title}\" from Audiobookshelf?","@adminMissingDeleteOneContent": {"placeholders": {"title": {@@ -2167,7 +2189,7 @@}}},- "adminMissingDeleteManyContent": "Remove {count} entries from Audiobookshelf? The files on disk are not deleted.",+ "adminMissingDeleteManyContent": "Remove {count} entries from Audiobookshelf?","@adminMissingDeleteManyContent": {"placeholders": {"count": {diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dartindex 91794d6a..ef8b2fb2 100644--- a/lib/l10n/app_localizations.dart+++ b/lib/l10n/app_localizations.dart@@ -6124,6 +6124,54 @@ abstract class AppLocalizations {/// **'Delete permission required. Ask the root admin to grant you the delete permission.'**String get deletePermissionRequired;+ /// No description provided for @deleteFilesCheckbox.+ ///+ /// In en, this message translates to:+ /// **'Also delete the files on the server'**+ String get deleteFilesCheckbox;++ /// No description provided for @deleteFilesCheckedHint.+ ///+ /// In en, this message translates to:+ /// **'The files are deleted from the server for good.'**+ String get deleteFilesCheckedHint;++ /// No description provided for @deleteFilesUncheckedHint.+ ///+ /// In en, this message translates to:+ /// **'The files stay on the server, so the next library scan can add this back.'**+ String get deleteFilesUncheckedHint;++ /// No description provided for @deleteFromServerAction.+ ///+ /// In en, this message translates to:+ /// **'Delete from Server'**+ String get deleteFromServerAction;++ /// No description provided for @deleteFromServerTitle.+ ///+ /// In en, this message translates to:+ /// **'Delete from server'**+ String get deleteFromServerTitle;++ /// No description provided for @deleteFromServerContent.+ ///+ /// In en, this message translates to:+ /// **'Delete \"{title}\" from Audiobookshelf?'**+ String deleteFromServerContent(String title);++ /// No description provided for @deletedFromServer.+ ///+ /// In en, this message translates to:+ /// **'Deleted \"{title}\"'**+ String deletedFromServer(String title);++ /// No description provided for @deleteFromServerFailed.+ ///+ /// In en, this message translates to:+ /// **'Couldn\'t delete that. Check the server logs.'**+ String get deleteFromServerFailed;+/// No description provided for @playlistNotFound.////// In en, this message translates to:@@ -7367,13 +7415,13 @@ abstract class AppLocalizations {/// No description provided for @adminMissingDeleteOneContent.////// In en, this message translates to:- /// **'Remove \"{title}\" from Audiobookshelf? The files on disk are not deleted.'**+ /// **'Remove \"{title}\" from Audiobookshelf?'**String adminMissingDeleteOneContent(String title);/// No description provided for @adminMissingDeleteManyContent.////// In en, this message translates to:- /// **'Remove {count} entries from Audiobookshelf? The files on disk are not deleted.'**+ /// **'Remove {count} entries from Audiobookshelf?'**String adminMissingDeleteManyContent(int count);/// No description provided for @adminMissingDeleteCount.diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dartindex a748da80..0389b141 100644--- a/lib/l10n/app_localizations_de.dart+++ b/lib/l10n/app_localizations_de.dart@@ -3389,6 +3389,37 @@ class AppLocalizationsDe extends AppLocalizations {String get deletePermissionRequired =>'Löschberechtigung erforderlich. Bitte wende dich hierzu an den Administrator.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist nicht gefunden';diff --git a/lib/l10n/app_localizations_el.dart b/lib/l10n/app_localizations_el.dartindex cade09cf..fe6cea0c 100644--- a/lib/l10n/app_localizations_el.dart+++ b/lib/l10n/app_localizations_el.dart@@ -3348,6 +3348,37 @@ class AppLocalizationsEl extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4081,12 +4112,12 @@ class AppLocalizationsEl extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dartindex cd99a536..b57f1a3c 100644--- a/lib/l10n/app_localizations_en.dart+++ b/lib/l10n/app_localizations_en.dart@@ -3348,6 +3348,37 @@ class AppLocalizationsEn extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4081,12 +4112,12 @@ class AppLocalizationsEn extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dartindex 1b170499..81ae0340 100644--- a/lib/l10n/app_localizations_es.dart+++ b/lib/l10n/app_localizations_es.dart@@ -3350,6 +3350,37 @@ class AppLocalizationsEs extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4083,12 +4114,12 @@ class AppLocalizationsEs extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dartindex c35c039e..577c77cd 100644--- a/lib/l10n/app_localizations_fr.dart+++ b/lib/l10n/app_localizations_fr.dart@@ -3368,6 +3368,37 @@ class AppLocalizationsFr extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4101,12 +4132,12 @@ class AppLocalizationsFr extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dartindex dd98159e..1151a969 100644--- a/lib/l10n/app_localizations_it.dart+++ b/lib/l10n/app_localizations_it.dart@@ -3348,6 +3348,37 @@ class AppLocalizationsIt extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4081,12 +4112,12 @@ class AppLocalizationsIt extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dartindex 7a808165..11726227 100644--- a/lib/l10n/app_localizations_ja.dart+++ b/lib/l10n/app_localizations_ja.dart@@ -3348,6 +3348,37 @@ class AppLocalizationsJa extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4081,12 +4112,12 @@ class AppLocalizationsJa extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_no.dart b/lib/l10n/app_localizations_no.dartindex f8bb5118..c56b7067 100644--- a/lib/l10n/app_localizations_no.dart+++ b/lib/l10n/app_localizations_no.dart@@ -3348,6 +3348,37 @@ class AppLocalizationsNo extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4081,12 +4112,12 @@ class AppLocalizationsNo extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dartindex 69922660..055b280f 100644--- a/lib/l10n/app_localizations_pt.dart+++ b/lib/l10n/app_localizations_pt.dart@@ -3348,6 +3348,37 @@ class AppLocalizationsPt extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4081,12 +4112,12 @@ class AppLocalizationsPt extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_ro.dart b/lib/l10n/app_localizations_ro.dartindex 93356eb2..8d364560 100644--- a/lib/l10n/app_localizations_ro.dart+++ b/lib/l10n/app_localizations_ro.dart@@ -3348,6 +3348,37 @@ class AppLocalizationsRo extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4081,12 +4112,12 @@ class AppLocalizationsRo extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dartindex d421d2ec..2cbd4eda 100644--- a/lib/l10n/app_localizations_ru.dart+++ b/lib/l10n/app_localizations_ru.dart@@ -3352,6 +3352,37 @@ class AppLocalizationsRu extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => 'Playlist not found';@@ -4085,12 +4116,12 @@ class AppLocalizationsRu extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dartindex 9666d6ba..dc1cf19c 100644--- a/lib/l10n/app_localizations_zh.dart+++ b/lib/l10n/app_localizations_zh.dart@@ -3276,6 +3276,37 @@ class AppLocalizationsZh extends AppLocalizations {String get deletePermissionRequired =>'Delete permission required. Ask the root admin to grant you the delete permission.';+ @override+ String get deleteFilesCheckbox => 'Also delete the files on the server';++ @override+ String get deleteFilesCheckedHint =>+ 'The files are deleted from the server for good.';++ @override+ String get deleteFilesUncheckedHint =>+ 'The files stay on the server, so the next library scan can add this back.';++ @override+ String get deleteFromServerAction => 'Delete from Server';++ @override+ String get deleteFromServerTitle => 'Delete from server';++ @override+ String deleteFromServerContent(String title) {+ return 'Delete \"$title\" from Audiobookshelf?';+ }++ @override+ String deletedFromServer(String title) {+ return 'Deleted \"$title\"';+ }++ @override+ String get deleteFromServerFailed =>+ 'Couldn\'t delete that. Check the server logs.';+@overrideString get playlistNotFound => '未找到播放列表';@@ -4000,12 +4031,12 @@ class AppLocalizationsZh extends AppLocalizations {@overrideString adminMissingDeleteOneContent(String title) {- return 'Remove \"$title\" from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove \"$title\" from Audiobookshelf?';}@overrideString adminMissingDeleteManyContent(int count) {- return 'Remove $count entries from Audiobookshelf? The files on disk are not deleted.';+ return 'Remove $count entries from Audiobookshelf?';}@overridediff --git a/lib/screens/admin_missing_items_screen.dart b/lib/screens/admin_missing_items_screen.dartindex cc0f98ee..2b5365c1 100644--- a/lib/screens/admin_missing_items_screen.dart+++ b/lib/screens/admin_missing_items_screen.dart@@ -6,6 +6,7 @@ import '../l10n/app_localizations.dart';import '../providers/auth_provider.dart';import '../services/socket_service.dart';import '../widgets/absorb_page_header.dart';+import '../widgets/delete_confirm_dialog.dart';import '../widgets/overlay_toast.dart';/// Admin cleanup screen: lists the items a library has flagged as "issues" -@@ -102,14 +103,14 @@ class _AdminMissingItemsScreenState extends State<AdminMissingItemsScreen> {Future<void> _deleteOne(Map<String, dynamic> item) async {final l = AppLocalizations.of(context)!;final title = _titleOf(item);- final yes = await _confirm(l.adminMissingDeleteTitle, l.adminMissingDeleteOneContent(title));- if (yes != true) return;+ final choice = await _confirm(l.adminMissingDeleteTitle, l.adminMissingDeleteOneContent(title));+ if (choice == null || !mounted) return;final id = item['id'] as String? ?? '';if (id.isEmpty) return;final api = context.read<AuthProvider>().apiService;if (api == null) return;setState(() => _deleting.add(id));- final status = await api.deleteLibraryItem(id);+ final status = await api.deleteLibraryItem(id, hard: choice.hardDelete);if (!mounted) return;setState(() => _deleting.remove(id));if (status == 200) {@@ -129,8 +130,8 @@ class _AdminMissingItemsScreenState extends State<AdminMissingItemsScreen> {if (_selected.isEmpty) return;final l = AppLocalizations.of(context)!;final count = _selected.length;- final yes = await _confirm(l.adminMissingDeleteTitle, l.adminMissingDeleteManyContent(count));- if (yes != true) return;+ final choice = await _confirm(l.adminMissingDeleteTitle, l.adminMissingDeleteManyContent(count));+ if (choice == null || !mounted) return;final api = context.read<AuthProvider>().apiService;if (api == null) return;final ids = Set<String>.from(_selected);@@ -141,7 +142,7 @@ class _AdminMissingItemsScreenState extends State<AdminMissingItemsScreen> {int deleted = 0;bool forbidden = false;for (final id in ids) {- final status = await api.deleteLibraryItem(id);+ final status = await api.deleteLibraryItem(id, hard: choice.hardDelete);if (status == 200) {deleted++;_items.removeWhere((it) => (it as Map)['id'] == id);@@ -160,20 +161,8 @@ class _AdminMissingItemsScreenState extends State<AdminMissingItemsScreen> {}}- Future<bool?> _confirm(String title, String content) => showDialog<bool>(- context: context,- builder: (ctx) => AlertDialog(- title: Text(title),- content: Text(content),- actions: [- TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text(AppLocalizations.of(context)!.cancel)),- TextButton(- onPressed: () => Navigator.pop(ctx, true),- child: Text(AppLocalizations.of(context)!.delete, style: TextStyle(color: Colors.red.shade300)),- ),- ],- ),- );+ Future<DeleteChoice?> _confirm(String title, String content) =>+ showDeleteConfirmDialog(context, title: title, message: content);@overrideWidget build(BuildContext context) {diff --git a/lib/screens/admin_podcasts_screen.dart b/lib/screens/admin_podcasts_screen.dartindex 71b09b2f..0bc819f9 100644--- a/lib/screens/admin_podcasts_screen.dart+++ b/lib/screens/admin_podcasts_screen.dart@@ -7,6 +7,7 @@ import '../providers/auth_provider.dart';import '../services/socket_service.dart';import 'podcast_edit_screen.dart';import '../widgets/absorb_page_header.dart';+import '../widgets/delete_confirm_dialog.dart';import '../widgets/html_description.dart';import '../widgets/overlay_toast.dart';import '../l10n/app_localizations.dart';@@ -1076,15 +1077,15 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleTFuture<void> _removeShow() async {final l = AppLocalizations.of(context)!;- final yes = await showDialog<bool>(context: context, builder: (ctx) => AlertDialog(- title: Text(l.adminPodcastsRemoveShowTitle),- content: Text(l.adminPodcastsRemoveShowContent(_title)),- actions: [TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text(l.cancel)),- TextButton(onPressed: () => Navigator.pop(ctx, true), child: Text(l.remove, style: TextStyle(color: Colors.red.shade300)))],- ));- if (yes != true) return;+ final choice = await showDeleteConfirmDialog(+ context,+ title: l.adminPodcastsRemoveShowTitle,+ message: l.adminPodcastsRemoveShowContent(_title),+ confirmLabel: l.remove,+ );+ if (choice == null || !mounted) return;final api = context.read<AuthProvider>().apiService; if (api == null) return;- final status = await api.deleteLibraryItem(_podcastId);+ final status = await api.deleteLibraryItem(_podcastId, hard: choice.hardDelete);if (mounted) {final l2 = AppLocalizations.of(context)!;if (status == 200) { _msg(l2.adminPodcastsRemovedShow(_title)); widget.onChanged(); Navigator.pop(context); }@@ -1189,16 +1190,15 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleTFuture<void> _deleteEpisode(String episodeId, String epTitle) async {final l = AppLocalizations.of(context)!;- final yes = await showDialog<bool>(context: context, builder: (ctx) => AlertDialog(- title: Text(l.adminPodcastsDeleteEpisodeTitle),- content: Text(l.adminPodcastsDeleteEpisodeContent(epTitle)),- actions: [TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text(l.cancel)),- TextButton(onPressed: () => Navigator.pop(ctx, true), child: Text(l.delete, style: TextStyle(color: Colors.red.shade300)))],- ));- if (yes != true) return;+ final choice = await showDeleteConfirmDialog(+ context,+ title: l.adminPodcastsDeleteEpisodeTitle,+ message: l.adminPodcastsDeleteEpisodeContent(epTitle),+ );+ if (choice == null || !mounted) return;final api = context.read<AuthProvider>().apiService; if (api == null) return;setState(() => _deleting.add(episodeId));- final status = await api.deletePodcastEpisode(_podcastId, episodeId);+ final status = await api.deletePodcastEpisode(_podcastId, episodeId, hard: choice.hardDelete);if (mounted) {final l2 = AppLocalizations.of(context)!;setState(() => _deleting.remove(episodeId));@@ -1328,22 +1328,19 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleTif (_selectedDownloadedIds.isEmpty) return;final count = _selectedDownloadedIds.length;final l = AppLocalizations.of(context)!;- final yes = await showDialog<bool>(context: context, builder: (ctx) => AlertDialog(- title: Text(l.adminPodcastsDeleteEpisodesTitle),- content: Text(l.adminPodcastsDeleteEpisodesContent(count)),- actions: [- TextButton(onPressed: () => Navigator.pop(ctx, false), child: Text(l.cancel)),- TextButton(onPressed: () => Navigator.pop(ctx, true), child: Text(l.delete, style: TextStyle(color: Colors.red.shade300))),- ],- ));- if (yes != true) return;+ final choice = await showDeleteConfirmDialog(+ context,+ title: l.adminPodcastsDeleteEpisodesTitle,+ message: l.adminPodcastsDeleteEpisodesContent(count),+ );+ if (choice == null || !mounted) return;final api = context.read<AuthProvider>().apiService; if (api == null) return;final ids = Set<String>.from(_selectedDownloadedIds);setState(() => _selectedDownloadedIds.clear());int deleted = 0;bool forbidden = false;for (final id in ids) {- final status = await api.deletePodcastEpisode(_podcastId, id);+ final status = await api.deletePodcastEpisode(_podcastId, id, hard: choice.hardDelete);if (status == 200) deleted++;else if (status == 403) { forbidden = true; break; }}diff --git a/lib/services/api_service.dart b/lib/services/api_service.dartindex cf550633..81fd05a7 100644--- a/lib/services/api_service.dart+++ b/lib/services/api_service.dart@@ -3562,10 +3562,12 @@ class ApiService {/// Returns the HTTP status code (0 on exception). 200 = success;/// 403 = caller lacks the `delete` permission flag on the server. Callers/// should surface 403 with a "needs delete permission" message.- Future<int> deletePodcastEpisode(String podcastId, String episodeId) async {+ /// [hard] true also deletes the episode's audio file from the server's disk;+ /// false leaves the file and only drops the episode from the database.+ Future<int> deletePodcastEpisode(String podcastId, String episodeId, {bool hard = false}) async {try {final r = await _authDelete(- Uri.parse('$_cleanBaseUrl/api/podcasts/$podcastId/episode/$episodeId'),+ Uri.parse('$_cleanBaseUrl/api/podcasts/$podcastId/episode/$episodeId?hard=${hard ? 1 : 0}'),);return r.statusCode;} catch (e) { debugPrint('deletePodcastEpisode error: $e'); }@@ -3573,10 +3575,13 @@ class ApiService {}/// Delete a library item (e.g. remove a podcast show). See [deletePodcastEpisode] for status semantics.- Future<int> deleteLibraryItem(String itemId) async {+ ///+ /// [hard] true deletes the item's folder from the server's disk as well;+ /// false keeps the files, so a later library scan can pick the item back up.+ Future<int> deleteLibraryItem(String itemId, {bool hard = false}) async {try {final r = await _authDelete(- Uri.parse('$_cleanBaseUrl/api/items/$itemId'),+ Uri.parse('$_cleanBaseUrl/api/items/$itemId?hard=${hard ? 1 : 0}'),);return r.statusCode;} catch (e) { debugPrint('deleteLibraryItem error: $e'); }diff --git a/lib/services/player_settings.dart b/lib/services/player_settings.dartindex c339ebc6..fe0f4155 100644--- a/lib/services/player_settings.dart+++ b/lib/services/player_settings.dart@@ -156,6 +156,12 @@ class PlayerSettings {static Future<bool> getUpcomingReleasesSortByDate() => _get('upcomingReleasesSortByDate', false);static Future<void> setUpcomingReleasesSortByDate(bool value) => _set('upcomingReleasesSortByDate', value);+ /// Last state of the "delete files from the server" checkbox in the delete+ /// confirm. Starts ticked and remembers what you picked, same as the web UI+ /// (which keeps `softDeleteDefault` in localStorage).+ static Future<bool> getDeleteFromFileSystem() => _get('deleteFromFileSystem', true);+ static Future<void> setDeleteFromFileSystem(bool value) => _set('deleteFromFileSystem', value);+static Future<bool> getWifiOnlyDownloads() => _get('wifiOnlyDownloads', false);static Future<void> setWifiOnlyDownloads(bool value) => _set('wifiOnlyDownloads', value);diff --git a/lib/widgets/book_detail_sheet.dart b/lib/widgets/book_detail_sheet.dartindex 37dae184..b7682490 100644--- a/lib/widgets/book_detail_sheet.dart+++ b/lib/widgets/book_detail_sheet.dart@@ -43,6 +43,7 @@ import 'html_description.dart';import 'metadata_lookup_sheet.dart';import 'playlist_picker_sheet.dart';import 'collection_picker_sheet.dart';+import 'delete_confirm_dialog.dart';import 'absorb_wave_icon.dart';import 'stackable_sheet.dart';import 'ebook_router.dart';@@ -1140,6 +1141,10 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {if (auth.canUpdateMetadata && !lib.isOffline) {add(Icons.edit_rounded, l.edit, () => _openEditPage(auth, title, isEbookOnly));}+ if (auth.canDelete && !lib.isOffline) {+ add(Icons.delete_outline_rounded, l.deleteFromServerAction,+ () => _deleteFromServer(context, auth, lib, title), tint: cs.error);+ }if (includeOpenDetails) {add(Icons.open_in_full_rounded, l.bookDetailsLabel, () {final rc = rootNavigatorKey.currentContext;@@ -2273,6 +2278,42 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {}}+ /// Delete the item on the server, optionally taking its files with it.+ /// Needs the `delete` permission — the server answers 403 without it.+ Future<void> _deleteFromServer(BuildContext context, AuthProvider auth,+ LibraryProvider lib, String title) async {+ final l = AppLocalizations.of(context)!;+ final api = auth.apiService;+ if (api == null) return;+ final choice = await showDeleteConfirmDialog(+ context,+ title: l.deleteFromServerTitle,+ message: l.deleteFromServerContent(title),+ );+ if (choice == null || !mounted) return;+ // Grab these before the sheet goes: the toast needs an overlay that+ // outlives it, and the pop needs the navigator the sheet sits on.+ final navigator = Navigator.of(context);+ final rootNavigator = rootNavigatorKey.currentState;+ final status = await api.deleteLibraryItem(widget.itemId, hard: choice.hardDelete);+ if (!mounted) return;+ if (status == 200) {+ final player = AudioPlayerService();+ if (player.currentItemId == widget.itemId) {+ await player.stopWithoutSaving();+ }+ await lib.removeFromAbsorbing(widget.itemId);+ if (navigator.canPop()) navigator.pop();+ await lib.refresh();+ showNavigatorOverlayToast(rootNavigator, l.deletedFromServer(title),+ icon: Icons.delete_outline_rounded);+ } else if (status == 403) {+ showOverlayToast(context, l.deletePermissionRequired, icon: Icons.lock_outline_rounded);+ } else {+ showOverlayToast(context, l.deleteFromServerFailed, icon: Icons.error_outline_rounded);+ }+ }+void _openGoodreads(String title, String author) async {final q = author.isNotEmpty ? '$title $author' : title;final uri = Uri.https('www.goodreads.com', '/search', {'q': q});diff --git a/lib/widgets/delete_confirm_dialog.dart b/lib/widgets/delete_confirm_dialog.dartnew file mode 100644index 00000000..a9b9fb5b--- /dev/null+++ b/lib/widgets/delete_confirm_dialog.dart@@ -0,0 +1,88 @@+import 'package:flutter/material.dart';+import '../l10n/app_localizations.dart';+import '../services/player_settings.dart';++/// What the user picked in [showDeleteConfirmDialog]. [hardDelete] true means+/// the server wipes the files on disk too (`?hard=1`), false means it only+/// drops the entry from its database.+class DeleteChoice {+ final bool hardDelete;+ const DeleteChoice(this.hardDelete);+}++/// Confirm a delete that happens on the Audiobookshelf server, offering the+/// same file-system choice the web UI does. Returns null when cancelled.+///+/// The checkbox starts ticked and remembers the last choice, matching the web+/// UI. [message] should say what is being deleted; the file-system wording is+/// added below it.+Future<DeleteChoice?> showDeleteConfirmDialog(+ BuildContext context, {+ required String title,+ required String message,+ String? confirmLabel,+}) async {+ final initial = await PlayerSettings.getDeleteFromFileSystem();+ if (!context.mounted) return null;+ final l = AppLocalizations.of(context)!;+ final choice = await showDialog<DeleteChoice>(+ context: context,+ builder: (ctx) {+ final cs = Theme.of(ctx).colorScheme;+ final tt = Theme.of(ctx).textTheme;+ bool hard = initial;+ return StatefulBuilder(+ builder: (ctx, setLocal) => AlertDialog(+ scrollable: true,+ title: Text(title),+ content: Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Text(message),+ const SizedBox(height: 8),+ InkWell(+ onTap: () => setLocal(() => hard = !hard),+ borderRadius: BorderRadius.circular(10),+ child: Row(children: [+ Checkbox(+ value: hard,+ onChanged: (v) => setLocal(() => hard = v ?? false),+ ),+ Expanded(child: Text(l.deleteFilesCheckbox, style: tt.bodyMedium)),+ ]),+ ),+ Padding(+ padding: const EdgeInsets.only(left: 4, top: 2),+ child: Text(+ hard ? l.deleteFilesCheckedHint : l.deleteFilesUncheckedHint,+ style: tt.bodySmall?.copyWith(+ color: hard ? cs.error : cs.onSurfaceVariant,+ ),+ ),+ ),+ ],+ ),+ actions: [+ TextButton(+ onPressed: () => Navigator.pop(ctx),+ child: Text(l.cancel),+ ),+ FilledButton(+ onPressed: () => Navigator.pop(ctx, DeleteChoice(hard)),+ style: FilledButton.styleFrom(+ backgroundColor: cs.error,+ foregroundColor: cs.onError,+ ),+ child: Text(confirmLabel ?? l.delete),+ ),+ ],+ ),+ );+ },+ );+ if (choice != null) {+ await PlayerSettings.setDeleteFromFileSystem(choice.hardDelete);+ }+ return choice;+}