Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Let admins upload books and podcasts from Absorb

Barnabas5be6ba9df08d
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index 62d53719..b38efa7e 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -3868,6 +3868,73 @@
"adminSessionsAllUsers": "All users",
"adminSessionsEmpty": "No sessions",
+ "adminUploadTitle": "Upload media",
+ "adminUploadSubtitle": "Add books and podcasts from files",
+ "adminUploadNoLibraries": "Create a library before uploading media.",
+ "adminUploadDestination": "Destination",
+ "adminUploadFolder": "Library folder",
+ "adminUploadDetails": "Item details",
+ "adminUploadOptional": "Optional",
+ "adminUploadDestinationPreview": "Server destination",
+ "adminUploadFiles": "Files",
+ "adminUploadSelectedFiles": "{count, plural, =1{1 file} other{{count} files}}",
+ "@adminUploadSelectedFiles": {
+ "placeholders": {
+ "count": {
+ "type": "int"
+ }
+ }
+ },
+ "adminUploadChooseFiles": "Choose files",
+ "adminUploadAddFiles": "Add files",
+ "adminUploadBookFilesHint": "Choose audio or ebook files. You can also include covers and metadata files.",
+ "adminUploadPodcastFilesHint": "Choose one or more audio files. You can also include covers and metadata files.",
+ "adminUploadUnsupportedFiles": "Some selected files are not supported by Audiobookshelf.",
+ "adminUploadFilePickerFailed": "Couldn't open the selected files.",
+ "adminUploadTitleRequired": "Enter a title",
+ "adminUploadLibraryRequired": "Choose a library",
+ "adminUploadFolderRequired": "Choose a library folder",
+ "adminUploadFilesRequired": "Choose at least one file",
+ "adminUploadPodcastFileRequired": "Choose at least one audio file for this podcast.",
+ "adminUploadBookFileRequired": "Choose at least one audio or ebook file for this book.",
+ "adminUploadPathCheckFailed": "Couldn't check the destination folder. Nothing was uploaded.",
+ "adminUploadDestinationExists": "That destination folder already exists on the server.",
+ "adminUploadDestinationUsedBy": "That destination is already used by \"{title}\".",
+ "@adminUploadDestinationUsedBy": {
+ "placeholders": {
+ "title": {
+ "type": "String"
+ }
+ }
+ },
+ "adminUploadUploading": "Uploading...",
+ "adminUploadProgress": "Uploading {percent}%",
+ "@adminUploadProgress": {
+ "placeholders": {
+ "percent": {
+ "type": "int"
+ }
+ }
+ },
+ "adminUploadButton": "Upload",
+ "adminUploadComplete": "Uploaded \"{title}\"",
+ "@adminUploadComplete": {
+ "placeholders": {
+ "title": {
+ "type": "String"
+ }
+ }
+ },
+ "adminUploadFailed": "Upload failed",
+ "adminUploadFailedReason": "Upload failed: {error}",
+ "@adminUploadFailedReason": {
+ "placeholders": {
+ "error": {
+ "type": "String"
+ }
+ }
+ },
+ "adminUploadReselectFiles": "Choose the files again before retrying.",
"statsLibraryTotals": "Library totals",
"statsTotalItems": "Items",
"statsAudioFiles": "Audio files",
diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart
index ebb014fc..6d3e3133 100644
--- a/lib/l10n/app_localizations.dart
+++ b/lib/l10n/app_localizations.dart
@@ -11283,6 +11283,198 @@ abstract class AppLocalizations {
/// **'Scanner, storage and sorting'**
String get adminServerSettingsSubtitle;
+ /// No description provided for @adminUploadTitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Upload media'**
+ String get adminUploadTitle;
+
+ /// No description provided for @adminUploadSubtitle.
+ ///
+ /// In en, this message translates to:
+ /// **'Add books and podcasts from files'**
+ String get adminUploadSubtitle;
+
+ /// No description provided for @adminUploadNoLibraries.
+ ///
+ /// In en, this message translates to:
+ /// **'Create a library before uploading media.'**
+ String get adminUploadNoLibraries;
+
+ /// No description provided for @adminUploadDestination.
+ ///
+ /// In en, this message translates to:
+ /// **'Destination'**
+ String get adminUploadDestination;
+
+ /// No description provided for @adminUploadFolder.
+ ///
+ /// In en, this message translates to:
+ /// **'Library folder'**
+ String get adminUploadFolder;
+
+ /// No description provided for @adminUploadDetails.
+ ///
+ /// In en, this message translates to:
+ /// **'Item details'**
+ String get adminUploadDetails;
+
+ /// No description provided for @adminUploadOptional.
+ ///
+ /// In en, this message translates to:
+ /// **'Optional'**
+ String get adminUploadOptional;
+
+ /// No description provided for @adminUploadDestinationPreview.
+ ///
+ /// In en, this message translates to:
+ /// **'Server destination'**
+ String get adminUploadDestinationPreview;
+
+ /// No description provided for @adminUploadFiles.
+ ///
+ /// In en, this message translates to:
+ /// **'Files'**
+ String get adminUploadFiles;
+
+ /// No description provided for @adminUploadSelectedFiles.
+ ///
+ /// In en, this message translates to:
+ /// **'{count, plural, =1{1 file} other{{count} files}}'**
+ String adminUploadSelectedFiles(int count);
+
+ /// No description provided for @adminUploadChooseFiles.
+ ///
+ /// In en, this message translates to:
+ /// **'Choose files'**
+ String get adminUploadChooseFiles;
+
+ /// No description provided for @adminUploadAddFiles.
+ ///
+ /// In en, this message translates to:
+ /// **'Add files'**
+ String get adminUploadAddFiles;
+
+ /// No description provided for @adminUploadBookFilesHint.
+ ///
+ /// In en, this message translates to:
+ /// **'Choose audio or ebook files. You can also include covers and metadata files.'**
+ String get adminUploadBookFilesHint;
+
+ /// No description provided for @adminUploadPodcastFilesHint.
+ ///
+ /// In en, this message translates to:
+ /// **'Choose one or more audio files. You can also include covers and metadata files.'**
+ String get adminUploadPodcastFilesHint;
+
+ /// No description provided for @adminUploadUnsupportedFiles.
+ ///
+ /// In en, this message translates to:
+ /// **'Some selected files are not supported by Audiobookshelf.'**
+ String get adminUploadUnsupportedFiles;
+
+ /// No description provided for @adminUploadFilePickerFailed.
+ ///
+ /// In en, this message translates to:
+ /// **'Couldn\'t open the selected files.'**
+ String get adminUploadFilePickerFailed;
+
+ /// No description provided for @adminUploadTitleRequired.
+ ///
+ /// In en, this message translates to:
+ /// **'Enter a title'**
+ String get adminUploadTitleRequired;
+
+ /// No description provided for @adminUploadLibraryRequired.
+ ///
+ /// In en, this message translates to:
+ /// **'Choose a library'**
+ String get adminUploadLibraryRequired;
+
+ /// No description provided for @adminUploadFolderRequired.
+ ///
+ /// In en, this message translates to:
+ /// **'Choose a library folder'**
+ String get adminUploadFolderRequired;
+
+ /// No description provided for @adminUploadFilesRequired.
+ ///
+ /// In en, this message translates to:
+ /// **'Choose at least one file'**
+ String get adminUploadFilesRequired;
+
+ /// No description provided for @adminUploadPodcastFileRequired.
+ ///
+ /// In en, this message translates to:
+ /// **'Choose at least one audio file for this podcast.'**
+ String get adminUploadPodcastFileRequired;
+
+ /// No description provided for @adminUploadBookFileRequired.
+ ///
+ /// In en, this message translates to:
+ /// **'Choose at least one audio or ebook file for this book.'**
+ String get adminUploadBookFileRequired;
+
+ /// No description provided for @adminUploadPathCheckFailed.
+ ///
+ /// In en, this message translates to:
+ /// **'Couldn\'t check the destination folder. Nothing was uploaded.'**
+ String get adminUploadPathCheckFailed;
+
+ /// No description provided for @adminUploadDestinationExists.
+ ///
+ /// In en, this message translates to:
+ /// **'That destination folder already exists on the server.'**
+ String get adminUploadDestinationExists;
+
+ /// No description provided for @adminUploadDestinationUsedBy.
+ ///
+ /// In en, this message translates to:
+ /// **'That destination is already used by \"{title}\".'**
+ String adminUploadDestinationUsedBy(String title);
+
+ /// No description provided for @adminUploadUploading.
+ ///
+ /// In en, this message translates to:
+ /// **'Uploading...'**
+ String get adminUploadUploading;
+
+ /// No description provided for @adminUploadProgress.
+ ///
+ /// In en, this message translates to:
+ /// **'Uploading {percent}%'**
+ String adminUploadProgress(int percent);
+
+ /// No description provided for @adminUploadButton.
+ ///
+ /// In en, this message translates to:
+ /// **'Upload'**
+ String get adminUploadButton;
+
+ /// No description provided for @adminUploadComplete.
+ ///
+ /// In en, this message translates to:
+ /// **'Uploaded \"{title}\"'**
+ String adminUploadComplete(String title);
+
+ /// No description provided for @adminUploadFailed.
+ ///
+ /// In en, this message translates to:
+ /// **'Upload failed'**
+ String get adminUploadFailed;
+
+ /// No description provided for @adminUploadFailedReason.
+ ///
+ /// In en, this message translates to:
+ /// **'Upload failed: {error}'**
+ String adminUploadFailedReason(String error);
+
+ /// No description provided for @adminUploadReselectFiles.
+ ///
+ /// In en, this message translates to:
+ /// **'Choose the files again before retrying.'**
+ String get adminUploadReselectFiles;
+
/// No description provided for @adminStats.
///
/// In en, this message translates to:
diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart
index 5ab6fe1b..1d2976c2 100644
--- a/lib/l10n/app_localizations_de.dart
+++ b/lib/l10n/app_localizations_de.dart
@@ -6554,6 +6554,128 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_el.dart b/lib/l10n/app_localizations_el.dart
index f63497ce..d3411379 100644
--- a/lib/l10n/app_localizations_el.dart
+++ b/lib/l10n/app_localizations_el.dart
@@ -6487,6 +6487,128 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart
index e36362e0..1956260c 100644
--- a/lib/l10n/app_localizations_en.dart
+++ b/lib/l10n/app_localizations_en.dart
@@ -6487,6 +6487,128 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart
index da0189ef..4b93bde9 100644
--- a/lib/l10n/app_localizations_es.dart
+++ b/lib/l10n/app_localizations_es.dart
@@ -6487,6 +6487,128 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart
index f492ba06..937ce4ba 100644
--- a/lib/l10n/app_localizations_fr.dart
+++ b/lib/l10n/app_localizations_fr.dart
@@ -6489,6 +6489,128 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart
index a934b826..da53398c 100644
--- a/lib/l10n/app_localizations_it.dart
+++ b/lib/l10n/app_localizations_it.dart
@@ -6487,6 +6487,128 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart
index 5ef08074..c5c78425 100644
--- a/lib/l10n/app_localizations_ja.dart
+++ b/lib/l10n/app_localizations_ja.dart
@@ -6487,6 +6487,128 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_no.dart b/lib/l10n/app_localizations_no.dart
index 9d6c950f..84c815d9 100644
--- a/lib/l10n/app_localizations_no.dart
+++ b/lib/l10n/app_localizations_no.dart
@@ -6487,6 +6487,128 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart
index 04fa02e5..4f81a516 100644
--- a/lib/l10n/app_localizations_pt.dart
+++ b/lib/l10n/app_localizations_pt.dart
@@ -6487,6 +6487,128 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_ro.dart b/lib/l10n/app_localizations_ro.dart
index 572c4b2e..c3f0b52a 100644
--- a/lib/l10n/app_localizations_ro.dart
+++ b/lib/l10n/app_localizations_ro.dart
@@ -6487,6 +6487,128 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart
index 97b0f725..163e9028 100644
--- a/lib/l10n/app_localizations_ru.dart
+++ b/lib/l10n/app_localizations_ru.dart
@@ -6490,6 +6490,128 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart
index a0aa3237..e096ea5d 100644
--- a/lib/l10n/app_localizations_zh.dart
+++ b/lib/l10n/app_localizations_zh.dart
@@ -6410,6 +6410,128 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get adminStats => 'Statistics';
+ @override
+ String get adminUploadTitle => 'Upload media';
+
+ @override
+ String get adminUploadSubtitle => 'Add books and podcasts from files';
+
+ @override
+ String get adminUploadNoLibraries =>
+ 'Create a library before uploading media.';
+
+ @override
+ String get adminUploadDestination => 'Destination';
+
+ @override
+ String get adminUploadFolder => 'Library folder';
+
+ @override
+ String get adminUploadDetails => 'Item details';
+
+ @override
+ String get adminUploadOptional => 'Optional';
+
+ @override
+ String get adminUploadDestinationPreview => 'Server destination';
+
+ @override
+ String get adminUploadFiles => 'Files';
+
+ @override
+ String adminUploadSelectedFiles(int count) {
+ String _temp0 = intl.Intl.pluralLogic(
+ count,
+ locale: localeName,
+ other: '$count files',
+ one: '1 file',
+ );
+ return '$_temp0';
+ }
+
+ @override
+ String get adminUploadChooseFiles => 'Choose files';
+
+ @override
+ String get adminUploadAddFiles => 'Add files';
+
+ @override
+ String get adminUploadBookFilesHint =>
+ 'Choose audio or ebook files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadPodcastFilesHint =>
+ 'Choose one or more audio files. You can also include covers and metadata files.';
+
+ @override
+ String get adminUploadUnsupportedFiles =>
+ 'Some selected files are not supported by Audiobookshelf.';
+
+ @override
+ String get adminUploadFilePickerFailed =>
+ 'Couldn\'t open the selected files.';
+
+ @override
+ String get adminUploadTitleRequired => 'Enter a title';
+
+ @override
+ String get adminUploadLibraryRequired => 'Choose a library';
+
+ @override
+ String get adminUploadFolderRequired => 'Choose a library folder';
+
+ @override
+ String get adminUploadFilesRequired => 'Choose at least one file';
+
+ @override
+ String get adminUploadPodcastFileRequired =>
+ 'Choose at least one audio file for this podcast.';
+
+ @override
+ String get adminUploadBookFileRequired =>
+ 'Choose at least one audio or ebook file for this book.';
+
+ @override
+ String get adminUploadPathCheckFailed =>
+ 'Couldn\'t check the destination folder. Nothing was uploaded.';
+
+ @override
+ String get adminUploadDestinationExists =>
+ 'That destination folder already exists on the server.';
+
+ @override
+ String adminUploadDestinationUsedBy(String title) {
+ return 'That destination is already used by \"$title\".';
+ }
+
+ @override
+ String get adminUploadUploading => 'Uploading...';
+
+ @override
+ String adminUploadProgress(int percent) {
+ return 'Uploading $percent%';
+ }
+
+ @override
+ String get adminUploadButton => 'Upload';
+
+ @override
+ String adminUploadComplete(String title) {
+ return 'Uploaded \"$title\"';
+ }
+
+ @override
+ String get adminUploadFailed => 'Upload failed';
+
+ @override
+ String adminUploadFailedReason(String error) {
+ return 'Upload failed: $error';
+ }
+
+ @override
+ String get adminUploadReselectFiles =>
+ 'Choose the files again before retrying.';
+
@override
String get adminStatsSubtitle => 'Library and listening totals';
diff --git a/lib/screens/admin_screen.dart b/lib/screens/admin_screen.dart
index 844265eb..8f9784ef 100644
--- a/lib/screens/admin_screen.dart
+++ b/lib/screens/admin_screen.dart
@@ -8,6 +8,7 @@ import '../widgets/absorb_page_header.dart';
import '../widgets/rmab_config_sheet.dart';
import '../l10n/app_localizations.dart';
import 'admin_users_screen.dart';
+import 'admin_upload_screen.dart';
import 'admin_podcasts_screen.dart';
import 'admin_missing_items_screen.dart';
import 'admin_email_screen.dart';
@@ -183,6 +184,21 @@ class _AdminScreenState extends State<AdminScreen> {
},
),
const SizedBox(height: 10),
+ _navButton(cs, tt,
+ icon: Icons.cloud_upload_rounded,
+ label: l.adminUploadTitle,
+ subtitle: l.adminUploadSubtitle,
+ onTap: () {
+ Navigator.push(context, MaterialPageRoute(
+ builder: (_) => AdminUploadScreen(
+ libraries: _libraries,
+ initialLibraryId: context.read<AuthProvider>().defaultLibraryId,
+ apiService: context.read<AuthProvider>().apiService,
+ ),
+ ));
+ },
+ ),
+ const SizedBox(height: 10),
if (_hasPodcastLibrary)
_navButton(cs, tt,
icon: Icons.podcasts_rounded,
diff --git a/lib/screens/admin_upload_screen.dart b/lib/screens/admin_upload_screen.dart
new file mode 100644
index 00000000..69a5d52a
--- /dev/null
+++ b/lib/screens/admin_upload_screen.dart
@@ -0,0 +1,874 @@
+import 'package:file_picker/file_picker.dart';
+import 'package:flutter/material.dart';
+
+import '../l10n/app_localizations.dart';
+import '../services/api_service.dart';
+import '../widgets/absorb_page_header.dart';
+import '../widgets/overlay_toast.dart';
+
+typedef UploadFilePicker = Future<List<MediaUploadFile>?> Function();
+typedef UploadPathChecker =
+ Future<UploadPathCheckResult> Function(String directory, String folderPath);
+typedef MediaUploader =
+ Future<MediaUploadResult> Function(
+ MediaUploadRequest request, {
+ void Function(int sentBytes, int totalBytes)? onProgress,
+ });
+
+class AdminUploadScreen extends StatefulWidget {
+ static const titleFieldKey = Key('adminUploadTitleField');
+ static const authorFieldKey = Key('adminUploadAuthorField');
+ static const seriesFieldKey = Key('adminUploadSeriesField');
+ static const libraryFieldKey = Key('adminUploadLibraryField');
+ static const folderFieldKey = Key('adminUploadFolderField');
+ static const mediaTypeKey = Key('adminUploadMediaType');
+ static const chooseFilesKey = Key('adminUploadChooseFiles');
+ static const submitKey = Key('adminUploadSubmit');
+
+ final List<dynamic> libraries;
+ final String? initialLibraryId;
+ final ApiService? apiService;
+ final UploadFilePicker? filePicker;
+ final UploadPathChecker? pathChecker;
+ final MediaUploader? uploader;
+
+ const AdminUploadScreen({
+ super.key,
+ required this.libraries,
+ this.initialLibraryId,
+ this.apiService,
+ this.filePicker,
+ this.pathChecker,
+ this.uploader,
+ });
+
+ @override
+ State<AdminUploadScreen> createState() => _AdminUploadScreenState();
+}
+
+class _AdminUploadScreenState extends State<AdminUploadScreen> {
+ static const _audioExtensions = <String>{
+ 'm4b',
+ 'mp3',
+ 'm4a',
+ 'flac',
+ 'opus',
+ 'ogg',
+ 'oga',
+ 'mp4',
+ 'aac',
+ 'wma',
+ 'aiff',
+ 'aif',
+ 'wav',
+ 'webm',
+ 'webma',
+ 'mka',
+ 'awb',
+ 'caf',
+ 'mpeg',
+ 'mpg',
+ };
+ static const _ebookExtensions = <String>{
+ 'epub',
+ 'pdf',
+ 'mobi',
+ 'azw3',
+ 'cbr',
+ 'cbz',
+ };
+ static const _otherExtensions = <String>{
+ 'png',
+ 'jpg',
+ 'jpeg',
+ 'webp',
+ 'nfo',
+ 'txt',
+ 'opf',
+ 'abs',
+ 'xml',
+ 'json',
+ };
+ static const _supportedExtensions = <String>{
+ ..._audioExtensions,
+ ..._ebookExtensions,
+ ..._otherExtensions,
+ };
+
+ final _formKey = GlobalKey<FormState>();
+ final _title = TextEditingController();
+ final _author = TextEditingController();
+ final _series = TextEditingController();
+
+ late final List<Map<String, dynamic>> _libraries;
+ String? _selectedLibraryId;
+ String? _selectedFolderId;
+ List<MediaUploadFile> _files = [];
+ bool _uploading = false;
+ double? _progress;
+ DateTime _lastProgressUpdate = DateTime.fromMillisecondsSinceEpoch(0);
+
+ @override
+ void initState() {
+ super.initState();
+ _libraries = widget.libraries
+ .whereType<Map>()
+ .map((library) => Map<String, dynamic>.from(library))
+ .toList();
+
+ Map<String, dynamic>? initialLibrary;
+ if (widget.initialLibraryId != null) {
+ for (final library in _libraries) {
+ if (library['id']?.toString() == widget.initialLibraryId) {
+ initialLibrary = library;
+ break;
+ }
+ }
+ }
+ initialLibrary ??= _libraries.firstOrNull;
+ _selectedLibraryId = initialLibrary?['id']?.toString();
+ _selectedFolderId = _foldersFor(
+ initialLibrary,
+ ).firstOrNull?['id']?.toString();
+ }
+
+ @override
+ void dispose() {
+ _title.dispose();
+ _author.dispose();
+ _series.dispose();
+ super.dispose();
+ }
+
+ Map<String, dynamic>? get _selectedLibrary {
+ for (final library in _libraries) {
+ if (library['id']?.toString() == _selectedLibraryId) return library;
+ }
+ return null;
+ }
+
+ List<Map<String, dynamic>> get _folders => _foldersFor(_selectedLibrary);
+
+ Map<String, dynamic>? get _selectedFolder {
+ for (final folder in _folders) {
+ if (folder['id']?.toString() == _selectedFolderId) return folder;
+ }
+ return null;
+ }
+
+ String get _mediaType => _selectedLibrary?['mediaType']?.toString() ?? 'book';
+ bool get _isPodcast => _mediaType == 'podcast';
+ String get _folderPath =>
+ _selectedFolder?['fullPath']?.toString() ??
+ _selectedFolder?['path']?.toString() ??
+ '';
+
+ List<Map<String, dynamic>> _foldersFor(Map<String, dynamic>? library) {
+ final folders = library?['folders'] as List? ?? const [];
+ return folders
+ .whereType<Map>()
+ .map((folder) => Map<String, dynamic>.from(folder))
+ .toList();
+ }
+
+ void _selectLibrary(String? id) {
+ if (id == null) return;
+ setState(() {
+ _selectedLibraryId = id;
+ _selectedFolderId = _folders.firstOrNull?['id']?.toString();
+ });
+ }
+
+ String _extension(String filename) {
+ final dot = filename.lastIndexOf('.');
+ if (dot < 0 || dot == filename.length - 1) return '';
+ return filename.substring(dot + 1).toLowerCase();
+ }
+
+ bool _isSupported(MediaUploadFile file) =>
+ _supportedExtensions.contains(_extension(file.name));
+
+ bool _isPrimaryFile(MediaUploadFile file) {
+ final extension = _extension(file.name);
+ return _audioExtensions.contains(extension) ||
+ (!_isPodcast && _ebookExtensions.contains(extension));
+ }
+
+ Future<List<MediaUploadFile>?> _pickWithFilePicker() async {
+ final result = await FilePicker.platform.pickFiles(
+ allowMultiple: true,
+ type: FileType.custom,
+ allowedExtensions: _supportedExtensions.toList()..sort(),
+ withReadStream: true,
+ );
+ if (result == null) return null;
+ return result.files
+ .map(
+ (file) => MediaUploadFile(
+ name: file.name,
+ size: file.size,
+ path: file.path,
+ bytes: file.bytes,
+ readStream: file.readStream,
+ ),
+ )
+ .toList();
+ }
+
+ Future<void> _pickFiles() async {
+ final l = AppLocalizations.of(context)!;
+ try {
+ final picked = await (widget.filePicker ?? _pickWithFilePicker)();
+ if (picked == null || picked.isEmpty || !mounted) return;
+ final supported = picked.where(_isSupported).toList();
+ if (supported.length != picked.length) {
+ showOverlayToast(
+ context,
+ l.adminUploadUnsupportedFiles,
+ icon: Icons.warning_amber_rounded,
+ );
+ }
+ if (supported.isEmpty) return;
+
+ final existing = <String>{
+ for (final file in _files) '${file.name}\u0000${file.size}',
+ };
+ final newFiles = supported
+ .where((file) => existing.add('${file.name}\u0000${file.size}'))
+ .toList();
+ if (newFiles.isEmpty) return;
+
+ setState(() {
+ _files = [..._files, ...newFiles];
+ if (_title.text.trim().isEmpty && _files.length == 1) {
+ final filename = _files.single.name;
+ final dot = filename.lastIndexOf('.');
+ _title.text = dot > 0 ? filename.substring(0, dot) : filename;
+ }
+ });
+ } catch (_) {
+ if (!mounted) return;
+ showOverlayToast(
+ context,
+ l.adminUploadFilePickerFailed,
+ icon: Icons.error_outline_rounded,
+ );
+ }
+ }
+
+ void _removeFile(int index) {
+ if (_uploading) return;
+ setState(() => _files = [..._files]..removeAt(index));
+ }
+
+ void _showError(String message) {
+ showOverlayToast(context, message, icon: Icons.error_outline_rounded);
+ }
+
+ void _updateProgress(int sentBytes, int totalBytes) {
+ if (!mounted || totalBytes <= 0) return;
+ final now = DateTime.now();
+ if (sentBytes < totalBytes &&
+ now.difference(_lastProgressUpdate) <
+ const Duration(milliseconds: 100)) {
+ return;
+ }
+ _lastProgressUpdate = now;
+ setState(() {
+ _progress = (sentBytes / totalBytes).clamp(0.0, 1.0);
+ });
+ }
+
+ Future<void> _submit() async {
+ final l = AppLocalizations.of(context)!;
+ if (!(_formKey.currentState?.validate() ?? false)) return;
+ if (_selectedLibraryId == null) {
+ _showError(l.adminUploadLibraryRequired);
+ return;
+ }
+ if (_selectedFolderId == null || _folderPath.isEmpty) {
+ _showError(l.adminUploadFolderRequired);
+ return;
+ }
+ if (_files.isEmpty) {
+ _showError(l.adminUploadFilesRequired);
+ return;
+ }
+ if (!_files.any(_isPrimaryFile)) {
+ _showError(
+ _isPodcast
+ ? l.adminUploadPodcastFileRequired
+ : l.adminUploadBookFileRequired,
+ );
+ return;
+ }
+
+ final request = MediaUploadRequest(
+ libraryId: _selectedLibraryId!,
+ folderId: _selectedFolderId!,
+ mediaType: _mediaType,
+ title: _title.text.trim(),
+ author: _author.text.trim(),
+ series: _series.text.trim(),
+ files: _files,
+ );
+
+ ApiService? api;
+ if (widget.pathChecker == null || widget.uploader == null) {
+ api = widget.apiService;
+ if (api == null) {
+ _showError(l.adminUploadFailed);
+ return;
+ }
+ }
+
+ setState(() {
+ _uploading = true;
+ _progress = null;
+ });
+
+ final pathResult = widget.pathChecker != null
+ ? await widget.pathChecker!(request.directory, _folderPath)
+ : await api!.checkUploadPathExists(
+ directory: request.directory,
+ folderPath: _folderPath,
+ );
+ if (!mounted) return;
+ if (!pathResult.success) {
+ setState(() => _uploading = false);
+ _showError(l.adminUploadPathCheckFailed);
+ return;
+ }
+ if (pathResult.exists) {
+ setState(() => _uploading = false);
+ final existingTitle = pathResult.libraryItemTitle;
+ _showError(
+ existingTitle == null || existingTitle.isEmpty
+ ? l.adminUploadDestinationExists
+ : l.adminUploadDestinationUsedBy(existingTitle),
+ );
+ return;
+ }
+
+ final result = widget.uploader != null
+ ? await widget.uploader!(request, onProgress: _updateProgress)
+ : await api!.uploadMedia(request, onProgress: _updateProgress);
+ if (!mounted) return;
+
+ final uploadedTitle = request.title;
+ final mustReselectFiles =
+ !result.success &&
+ _files.any(
+ (file) =>
+ file.path == null &&
+ file.bytes == null &&
+ file.readStream != null,
+ );
+ setState(() {
+ _uploading = false;
+ _progress = null;
+ if (result.success) {
+ _title.clear();
+ _author.clear();
+ _series.clear();
+ _files = [];
+ } else if (mustReselectFiles) {
+ _files = [];
+ }
+ });
+
+ if (result.success) {
+ showOverlayToast(
+ context,
+ l.adminUploadComplete(uploadedTitle),
+ icon: Icons.check_circle_outline_rounded,
+ );
+ } else {
+ final error = result.error?.trim();
+ final message = error == null || error.isEmpty
+ ? l.adminUploadFailed
+ : l.adminUploadFailedReason(error);
+ _showError(
+ mustReselectFiles ? '$message ${l.adminUploadReselectFiles}' : message,
+ );
+ }
+ }
+
+ MediaUploadRequest? get _draft {
+ if (_selectedLibraryId == null || _selectedFolderId == null) return null;
+ final title = _title.text.trim();
+ if (title.isEmpty) return null;
+ return MediaUploadRequest(
+ libraryId: _selectedLibraryId!,
+ folderId: _selectedFolderId!,
+ mediaType: _mediaType,
+ title: title,
+ author: _author.text.trim(),
+ series: _series.text.trim(),
+ files: _files,
+ );
+ }
+
+ String _formatBytes(int bytes) {
+ if (bytes < 1024) return '$bytes B';
+ final kb = bytes / 1024;
+ if (kb < 1024) return '${kb.toStringAsFixed(kb >= 10 ? 0 : 1)} KB';
+ final mb = kb / 1024;
+ if (mb < 1024) return '${mb.toStringAsFixed(mb >= 10 ? 0 : 1)} MB';
+ final gb = mb / 1024;
+ return '${gb.toStringAsFixed(gb >= 10 ? 1 : 2)} GB';
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final cs = Theme.of(context).colorScheme;
+ final tt = Theme.of(context).textTheme;
+ final l = AppLocalizations.of(context)!;
+
+ return Scaffold(
+ backgroundColor: Theme.of(context).scaffoldBackgroundColor,
+ body: SafeArea(
+ child: Column(
+ children: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(20, 12, 8, 0),
+ child: Row(
+ children: [
+ Expanded(
+ child: AbsorbPageHeader(
+ title: l.adminUploadTitle,
+ padding: EdgeInsets.zero,
+ ),
+ ),
+ IconButton(
+ icon: Icon(Icons.close_rounded, color: cs.onSurfaceVariant),
+ onPressed: _uploading ? null : () => Navigator.pop(context),
+ ),
+ ],
+ ),
+ ),
+ const SizedBox(height: 8),
+ Expanded(
+ child: _libraries.isEmpty
+ ? Center(
+ child: Padding(
+ padding: const EdgeInsets.all(32),
+ child: Text(
+ l.adminUploadNoLibraries,
+ textAlign: TextAlign.center,
+ style: tt.bodyMedium?.copyWith(
+ color: cs.onSurfaceVariant,
+ ),
+ ),
+ ),
+ )
+ : Form(
+ key: _formKey,
+ child: ListView(
+ padding: const EdgeInsets.fromLTRB(16, 8, 16, 80),
+ children: [
+ Center(
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 760),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ _destinationCard(cs, tt, l),
+ const SizedBox(height: 12),
+ _detailsCard(cs, tt, l),
+ const SizedBox(height: 12),
+ _filesCard(cs, tt, l),
+ const SizedBox(height: 16),
+ if (_uploading) ...[
+ LinearProgressIndicator(value: _progress),
+ const SizedBox(height: 8),
+ Text(
+ _progress == null
+ ? l.adminUploadUploading
+ : l.adminUploadProgress(
+ (_progress! * 100).round(),
+ ),
+ textAlign: TextAlign.center,
+ style: tt.bodySmall?.copyWith(
+ color: cs.onSurfaceVariant,
+ ),
+ ),
+ const SizedBox(height: 12),
+ ],
+ FilledButton.icon(
+ key: AdminUploadScreen.submitKey,
+ onPressed: _uploading ? null : _submit,
+ icon: _uploading
+ ? SizedBox(
+ width: 18,
+ height: 18,
+ child: CircularProgressIndicator(
+ strokeWidth: 2,
+ color: cs.onPrimary,
+ ),
+ )
+ : const Icon(
+ Icons.cloud_upload_rounded,
+ ),
+ label: Text(
+ _uploading
+ ? l.adminUploadUploading
+ : l.adminUploadButton,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget _destinationCard(ColorScheme cs, TextTheme tt, AppLocalizations l) {
+ return _card(
+ cs,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Text(
+ l.adminUploadDestination,
+ style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w700),
+ ),
+ const SizedBox(height: 14),
+ _dropdown<String>(
+ key: AdminUploadScreen.libraryFieldKey,
+ cs: cs,
+ label: l.libraryTitle,
+ value: _selectedLibraryId,
+ enabled: !_uploading,
+ items: [
+ for (final library in _libraries)
+ DropdownMenuItem(
+ value: library['id']?.toString(),
+ child: Text(
+ library['name']?.toString() ?? l.libraryFallback,
+ overflow: TextOverflow.ellipsis,
+ ),
+ ),
+ ],
+ onChanged: _selectLibrary,
+ ),
+ const SizedBox(height: 12),
+ _dropdown<String>(
+ key: AdminUploadScreen.folderFieldKey,
+ cs: cs,
+ label: l.adminUploadFolder,
+ value: _selectedFolderId,
+ enabled: !_uploading && _folders.isNotEmpty,
+ items: [
+ for (final folder in _folders)
+ DropdownMenuItem(
+ value: folder['id']?.toString(),
+ child: Text(
+ folder['fullPath']?.toString() ??
+ folder['path']?.toString() ??
+ '',
+ overflow: TextOverflow.ellipsis,
+ ),
+ ),
+ ],
+ onChanged: (id) => setState(() => _selectedFolderId = id),
+ ),
+ const SizedBox(height: 12),
+ Row(
+ children: [
+ Text(
+ '${l.libMediaType}:',
+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant),
+ ),
+ const SizedBox(width: 8),
+ Container(
+ key: AdminUploadScreen.mediaTypeKey,
+ padding: const EdgeInsets.symmetric(
+ horizontal: 10,
+ vertical: 5,
+ ),
+ decoration: BoxDecoration(
+ color: cs.primary.withValues(alpha: 0.12),
+ borderRadius: BorderRadius.circular(999),
+ ),
+ child: Text(
+ _isPodcast ? l.libMediaPodcast : l.libMediaBook,
+ style: tt.labelMedium?.copyWith(
+ color: cs.primary,
+ fontWeight: FontWeight.w700,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ );
+ }
+
+ Widget _detailsCard(ColorScheme cs, TextTheme tt, AppLocalizations l) {
+ final draft = _draft;
+ final destination = draft == null || _folderPath.isEmpty
+ ? null
+ : '${_folderPath.replaceAll(RegExp(r'[\\/]+$'), '')}/${draft.directory}';
+ return _card(
+ cs,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Text(
+ l.adminUploadDetails,
+ style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w700),
+ ),
+ const SizedBox(height: 14),
+ TextFormField(
+ key: AdminUploadScreen.titleFieldKey,
+ controller: _title,
+ enabled: !_uploading,
+ textInputAction: TextInputAction.next,
+ decoration: InputDecoration(labelText: l.title),
+ validator: (value) => value == null || value.trim().isEmpty
+ ? l.adminUploadTitleRequired
+ : null,
+ onChanged: (_) => setState(() {}),
+ ),
+ if (!_isPodcast) ...[
+ const SizedBox(height: 12),
+ LayoutBuilder(
+ builder: (context, constraints) {
+ final author = TextFormField(
+ key: AdminUploadScreen.authorFieldKey,
+ controller: _author,
+ enabled: !_uploading,
+ textInputAction: TextInputAction.next,
+ decoration: InputDecoration(
+ labelText: l.author,
+ hintText: l.adminUploadOptional,
+ ),
+ onChanged: (_) => setState(() {}),
+ );
+ final series = TextFormField(
+ key: AdminUploadScreen.seriesFieldKey,
+ controller: _series,
+ enabled: !_uploading,
+ decoration: InputDecoration(
+ labelText: l.seriesLabel,
+ hintText: l.adminUploadOptional,
+ ),
+ onChanged: (_) => setState(() {}),
+ );
+ if (constraints.maxWidth < 560) {
+ return Column(
+ children: [author, const SizedBox(height: 12), series],
+ );
+ }
+ return Row(
+ children: [
+ Expanded(child: author),
+ const SizedBox(width: 12),
+ Expanded(child: series),
+ ],
+ );
+ },
+ ),
+ ],
+ if (destination != null) ...[
+ const SizedBox(height: 14),
+ Container(
+ padding: const EdgeInsets.all(12),
+ decoration: BoxDecoration(
+ color: cs.surfaceContainerHighest,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ l.adminUploadDestinationPreview,
+ style: tt.labelSmall?.copyWith(
+ color: cs.onSurfaceVariant,
+ fontWeight: FontWeight.w700,
+ ),
+ ),
+ const SizedBox(height: 4),
+ Text(
+ destination,
+ style: tt.bodySmall?.copyWith(fontFamily: 'monospace'),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ],
+ ),
+ );
+ }
+
+ Widget _filesCard(ColorScheme cs, TextTheme tt, AppLocalizations l) {
+ final totalBytes = _files.fold<int>(0, (total, file) => total + file.size);
+ return _card(
+ cs,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Row(
+ children: [
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ l.adminUploadFiles,
+ style: tt.titleSmall?.copyWith(
+ fontWeight: FontWeight.w700,
+ ),
+ ),
+ if (_files.isNotEmpty)
+ Text(
+ '${l.adminUploadSelectedFiles(_files.length)} · ${_formatBytes(totalBytes)}',
+ style: tt.bodySmall?.copyWith(
+ color: cs.onSurfaceVariant,
+ ),
+ ),
+ ],
+ ),
+ ),
+ OutlinedButton.icon(
+ key: AdminUploadScreen.chooseFilesKey,
+ onPressed: _uploading ? null : _pickFiles,
+ icon: Icon(
+ _files.isEmpty
+ ? Icons.attach_file_rounded
+ : Icons.add_rounded,
+ size: 18,
+ ),
+ label: Text(
+ _files.isEmpty
+ ? l.adminUploadChooseFiles
+ : l.adminUploadAddFiles,
+ ),
+ ),
+ ],
+ ),
+ const SizedBox(height: 10),
+ if (_files.isEmpty)
+ Container(
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
+ decoration: BoxDecoration(
+ color: cs.surfaceContainerHighest,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: Column(
+ children: [
+ Icon(
+ Icons.upload_file_rounded,
+ size: 32,
+ color: cs.onSurfaceVariant.withValues(alpha: 0.5),
+ ),
+ const SizedBox(height: 8),
+ Text(
+ _isPodcast
+ ? l.adminUploadPodcastFilesHint
+ : l.adminUploadBookFilesHint,
+ textAlign: TextAlign.center,
+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant),
+ ),
+ ],
+ ),
+ )
+ else
+ ...List.generate(_files.length, (index) {
+ final file = _files[index];
+ return Container(
+ margin: EdgeInsets.only(top: index == 0 ? 0 : 8),
+ padding: const EdgeInsets.fromLTRB(12, 8, 4, 8),
+ decoration: BoxDecoration(
+ color: cs.surfaceContainerHighest,
+ borderRadius: BorderRadius.circular(12),
+ ),
+ child: Row(
+ children: [
+ Icon(
+ _isPrimaryFile(file)
+ ? Icons.audio_file_rounded
+ : Icons.description_outlined,
+ color: cs.primary,
+ size: 20,
+ ),
+ const SizedBox(width: 10),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ file.name,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: tt.bodyMedium,
+ ),
+ Text(
+ _formatBytes(file.size),
+ style: tt.bodySmall?.copyWith(
+ color: cs.onSurfaceVariant,
+ ),
+ ),
+ ],
+ ),
+ ),
+ IconButton(
+ tooltip: l.remove,
+ onPressed: _uploading ? null : () => _removeFile(index),
+ icon: const Icon(Icons.close_rounded, size: 19),
+ ),
+ ],
+ ),
+ );
+ }),
+ ],
+ ),
+ );
+ }
+
+ Widget _card(ColorScheme cs, {required Widget child}) {
+ return Container(
+ padding: const EdgeInsets.all(16),
+ decoration: BoxDecoration(
+ color: cs.surfaceContainerHigh,
+ borderRadius: BorderRadius.circular(16),
+ ),
+ child: child,
+ );
+ }
+
+ Widget _dropdown<T>({
+ required Key key,
+ required ColorScheme cs,
+ required String label,
+ required T? value,
+ required bool enabled,
+ required List<DropdownMenuItem<T>> items,
+ required ValueChanged<T?> onChanged,
+ }) {
+ return InputDecorator(
+ decoration: InputDecoration(labelText: label),
+ child: DropdownButtonHideUnderline(
+ child: DropdownButton<T>(
+ key: key,
+ value: value,
+ isExpanded: true,
+ isDense: true,
+ icon: Icon(Icons.expand_more_rounded, color: cs.onSurfaceVariant),
+ items: items,
+ onChanged: enabled ? onChanged : null,
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/services/api_service.dart b/lib/services/api_service.dart
index 267b887e..444f614d 100644
--- a/lib/services/api_service.dart
+++ b/lib/services/api_service.dart
@@ -14,6 +14,73 @@ class LocalSessionResult {
const LocalSessionResult({required this.ok, required this.serverTooOld});
}
+class MediaUploadFile {
+ final String name;
+ final int size;
+ final String? path;
+ final Uint8List? bytes;
+ final Stream<List<int>>? readStream;
+
+ const MediaUploadFile({
+ required this.name,
+ required this.size,
+ this.path,
+ this.bytes,
+ this.readStream,
+ });
+}
+
+class MediaUploadRequest {
+ final String libraryId;
+ final String folderId;
+ final String mediaType;
+ final String title;
+ final String? author;
+ final String? series;
+ final List<MediaUploadFile> files;
+
+ const MediaUploadRequest({
+ required this.libraryId,
+ required this.folderId,
+ required this.mediaType,
+ required this.title,
+ this.author,
+ this.series,
+ required this.files,
+ });
+
+ String get directory {
+ final parts = mediaType == 'podcast'
+ ? <String?>[title]
+ : <String?>[author, series, title];
+ return parts
+ .map((part) => part?.trim() ?? '')
+ .where((part) => part.isNotEmpty)
+ .join('/');
+ }
+}
+
+class UploadPathCheckResult {
+ final bool success;
+ final bool exists;
+ final String? libraryItemTitle;
+ final String? error;
+
+ const UploadPathCheckResult({
+ required this.success,
+ this.exists = false,
+ this.libraryItemTitle,
+ this.error,
+ });
+}
+
+class MediaUploadResult {
+ final bool success;
+ final String? error;
+
+ const MediaUploadResult({required this.success, this.error});
+}
+
class ApiService {
static String appVersion = '1.3.0'; // fallback; overwritten by initVersion()
static String appBuild = ''; // build number; set by initVersion()
@@ -2090,6 +2157,128 @@ class ApiService {
return [];
}
+ /// Check whether Audiobookshelf's destination directory for an upload is
+ /// already in use. The web client performs this check before POST /api/upload
+ /// so files are not merged into an existing library item directory.
+ Future<UploadPathCheckResult> checkUploadPathExists({
+ required String directory,
+ required String folderPath,
+ }) async {
+ try {
+ final response = await _authPost(
+ Uri.parse('$_cleanBaseUrl/api/filesystem/pathexists'),
+ body: jsonEncode({
+ 'directory': directory,
+ 'folderPath': folderPath,
+ }),
+ timeout: const Duration(seconds: 20),
+ );
+ if (response.statusCode == 200) {
+ final data = jsonDecode(response.body) as Map<String, dynamic>;
+ return UploadPathCheckResult(
+ success: true,
+ exists: data['exists'] == true,
+ libraryItemTitle: data['libraryItemTitle'] as String?,
+ );
+ }
+ final error = response.body.trim();
+ return UploadPathCheckResult(
+ success: false,
+ error: error.isEmpty ? 'HTTP ${response.statusCode}' : error,
+ );
+ } catch (e) {
+ debugPrint('[API] checkUploadPathExists error: $e');
+ return UploadPathCheckResult(success: false, error: '$e');
+ }
+ }
+
+ /// Upload one book or podcast and its related files to Audiobookshelf.
+ /// File fields are numbered to match the server's web uploader.
+ Future<MediaUploadResult> uploadMedia(
+ MediaUploadRequest upload, {
+ void Function(int sentBytes, int totalBytes)? onProgress,
+ }) async {
+ try {
+ final request = http.MultipartRequest(
+ 'POST',
+ Uri.parse('$_cleanBaseUrl/api/upload'),
+ );
+ request.headers.addAll(mediaHeaders);
+ request.fields.addAll({
+ 'title': upload.title.trim(),
+ 'library': upload.libraryId,
+ 'folder': upload.folderId,
+ if (upload.mediaType != 'podcast') ...{
+ 'author': upload.author?.trim() ?? '',
+ 'series': upload.series?.trim() ?? '',
+ },
+ });
+
+ final totalBytes = upload.files.fold<int>(
+ 0,
+ (total, file) => total + file.size,
+ );
+ var sentBytes = 0;
+
+ for (var i = 0; i < upload.files.length; i++) {
+ final file = upload.files[i];
+ if (file.bytes != null) {
+ final source = Stream<List<int>>.value(file.bytes!);
+ final tracked = source.map((chunk) {
+ sentBytes += chunk.length;
+ onProgress?.call(sentBytes, totalBytes);
+ return chunk;
+ });
+ request.files.add(http.MultipartFile(
+ '$i',
+ tracked,
+ file.size > 0 ? file.size : file.bytes!.length,
+ filename: file.name,
+ ));
+ } else if (file.path != null && file.path!.isNotEmpty) {
+ request.files.add(await http.MultipartFile.fromPath(
+ '$i',
+ file.path!,
+ filename: file.name,
+ ));
+ } else if (file.readStream != null) {
+ final tracked = file.readStream!.map((chunk) {
+ sentBytes += chunk.length;
+ onProgress?.call(sentBytes, totalBytes);
+ return chunk;
+ });
+ request.files.add(http.MultipartFile(
+ '$i',
+ tracked,
+ file.size,
+ filename: file.name,
+ ));
+ } else {
+ return MediaUploadResult(
+ success: false,
+ error: 'Unable to read ${file.name}',
+ );
+ }
+ }
+
+ final streamedResponse = await request.send();
+ final response = await http.Response.fromStream(streamedResponse);
+ if (response.statusCode == 200) {
+ onProgress?.call(totalBytes, totalBytes);
+ return const MediaUploadResult(success: true);
+ }
+
+ final error = response.body.trim();
+ return MediaUploadResult(
+ success: false,
+ error: error.isEmpty ? 'HTTP ${response.statusCode}' : error,
+ );
+ } catch (e) {
+ debugPrint('[API] uploadMedia error: $e');
+ return MediaUploadResult(success: false, error: '$e');
+ }
+ }
+
/// Create a backup (admin only)
Future<bool> createBackup() async {
try {