A cross platform Audiobookshelf client for Android and iOS
Dart
Show which books have an ebook, fit the author line on Home cards, and say when only the ebook is on the phone while offline
Barnabas487420e7f47f
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arbindex f2f4f94a..7601247e 100644--- a/lib/l10n/app_en.arb+++ b/lib/l10n/app_en.arb@@ -1508,6 +1508,8 @@"absorbAgain": "Absorb Again","absorb": "Absorb","ebookOnlyNoAudio": "eBook Only - No Audio",+ "absorbAudioNotDownloaded": "Audio not downloaded",+ "absorbAudioNotDownloadedEbookOnly": "Audio not downloaded, ebook only","fullyAbsorbed": "Fully Absorbed","fullyAbsorbAction": "Fully Absorb","removeFromAbsorbing": "Remove from Absorbing",@@ -2049,6 +2051,9 @@"showExplicitBadge": "Show explicit badge","showExplicitBadgeOnSubtitle": "Explicit items show an \"E\" badge","showExplicitBadgeOffSubtitle": "Off - explicit badge hidden",+ "showEbookBadge": "Show ebook badge",+ "showEbookBadgeOnSubtitle": "Books with an ebook show a book icon on the cover",+ "showEbookBadgeOffSubtitle": "Off - ebook badge hidden","libraryFallback": "Library","preReleaseUpdatesInfoTitle": "Pre-release Updates","preReleaseUpdatesInfoContent": "When enabled, the update checker will also notify you about alpha and pre-release builds from GitHub. These may be less stable but include the latest features and fixes.",diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dartindex 3abfbb51..2395502b 100644--- a/lib/l10n/app_localizations.dart+++ b/lib/l10n/app_localizations.dart@@ -5464,6 +5464,18 @@ abstract class AppLocalizations {/// **'eBook Only - No Audio'**String get ebookOnlyNoAudio;+ /// No description provided for @absorbAudioNotDownloaded.+ ///+ /// In en, this message translates to:+ /// **'Audio not downloaded'**+ String get absorbAudioNotDownloaded;++ /// No description provided for @absorbAudioNotDownloadedEbookOnly.+ ///+ /// In en, this message translates to:+ /// **'Audio not downloaded, ebook only'**+ String get absorbAudioNotDownloadedEbookOnly;+/// No description provided for @fullyAbsorbed.////// In en, this message translates to:@@ -7214,6 +7226,24 @@ abstract class AppLocalizations {/// **'Off - explicit badge hidden'**String get showExplicitBadgeOffSubtitle;+ /// No description provided for @showEbookBadge.+ ///+ /// In en, this message translates to:+ /// **'Show ebook badge'**+ String get showEbookBadge;++ /// No description provided for @showEbookBadgeOnSubtitle.+ ///+ /// In en, this message translates to:+ /// **'Books with an ebook show a book icon on the cover'**+ String get showEbookBadgeOnSubtitle;++ /// No description provided for @showEbookBadgeOffSubtitle.+ ///+ /// In en, this message translates to:+ /// **'Off - ebook badge hidden'**+ String get showEbookBadgeOffSubtitle;+/// No description provided for @libraryFallback.////// In en, this message translates to:diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dartindex 83a9f0c6..20262694 100644--- a/lib/l10n/app_localizations_de.dart+++ b/lib/l10n/app_localizations_de.dart@@ -3057,6 +3057,13 @@ class AppLocalizationsDe extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'Nur eBook - kein Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Vollständig Absorbed';@@ -4046,6 +4053,16 @@ class AppLocalizationsDe extends AppLocalizations {String get showExplicitBadgeOffSubtitle =>'Aus - Explicit-Abzeichen ausgeblendet';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Bibliothek';diff --git a/lib/l10n/app_localizations_el.dart b/lib/l10n/app_localizations_el.dartindex d223272b..df4d8cfa 100644--- a/lib/l10n/app_localizations_el.dart+++ b/lib/l10n/app_localizations_el.dart@@ -3014,6 +3014,13 @@ class AppLocalizationsEl extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Fully Absorbed';@@ -3991,6 +3998,16 @@ class AppLocalizationsEl extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dartindex 0a22ad17..a10e5cd6 100644--- a/lib/l10n/app_localizations_en.dart+++ b/lib/l10n/app_localizations_en.dart@@ -3014,6 +3014,13 @@ class AppLocalizationsEn extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Fully Absorbed';@@ -3991,6 +3998,16 @@ class AppLocalizationsEn extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dartindex 0d43876b..e6d0318f 100644--- a/lib/l10n/app_localizations_es.dart+++ b/lib/l10n/app_localizations_es.dart@@ -3016,6 +3016,13 @@ class AppLocalizationsEs extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Fully Absorbed';@@ -3993,6 +4000,16 @@ class AppLocalizationsEs extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dartindex d7a32f67..e0806d5e 100644--- a/lib/l10n/app_localizations_fr.dart+++ b/lib/l10n/app_localizations_fr.dart@@ -3065,6 +3065,13 @@ class AppLocalizationsFr extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Entièrement absorbé';@@ -4042,6 +4049,16 @@ class AppLocalizationsFr extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Bibliothèque';diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dartindex 03c822ea..5ff11957 100644--- a/lib/l10n/app_localizations_it.dart+++ b/lib/l10n/app_localizations_it.dart@@ -3014,6 +3014,13 @@ class AppLocalizationsIt extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Fully Absorbed';@@ -3991,6 +3998,16 @@ class AppLocalizationsIt extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dartindex 9210015a..9b888532 100644--- a/lib/l10n/app_localizations_ja.dart+++ b/lib/l10n/app_localizations_ja.dart@@ -3014,6 +3014,13 @@ class AppLocalizationsJa extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Fully Absorbed';@@ -3991,6 +3998,16 @@ class AppLocalizationsJa extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/l10n/app_localizations_no.dart b/lib/l10n/app_localizations_no.dartindex 4adc3ab4..64f26f5d 100644--- a/lib/l10n/app_localizations_no.dart+++ b/lib/l10n/app_localizations_no.dart@@ -3014,6 +3014,13 @@ class AppLocalizationsNo extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Fully Absorbed';@@ -3991,6 +3998,16 @@ class AppLocalizationsNo extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dartindex e4356f5f..ad41def1 100644--- a/lib/l10n/app_localizations_pt.dart+++ b/lib/l10n/app_localizations_pt.dart@@ -3014,6 +3014,13 @@ class AppLocalizationsPt extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Fully Absorbed';@@ -3991,6 +3998,16 @@ class AppLocalizationsPt extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/l10n/app_localizations_ro.dart b/lib/l10n/app_localizations_ro.dartindex d01674ca..31c2a756 100644--- a/lib/l10n/app_localizations_ro.dart+++ b/lib/l10n/app_localizations_ro.dart@@ -3014,6 +3014,13 @@ class AppLocalizationsRo extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Fully Absorbed';@@ -3991,6 +3998,16 @@ class AppLocalizationsRo extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dartindex 0b760248..d1be1190 100644--- a/lib/l10n/app_localizations_ru.dart+++ b/lib/l10n/app_localizations_ru.dart@@ -3018,6 +3018,13 @@ class AppLocalizationsRu extends AppLocalizations {@overrideString get ebookOnlyNoAudio => 'eBook Only - No Audio';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => 'Fully Absorbed';@@ -3995,6 +4002,16 @@ class AppLocalizationsRu extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => 'Off - explicit badge hidden';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dartindex 4ad1c0ef..3b47856a 100644--- a/lib/l10n/app_localizations_zh.dart+++ b/lib/l10n/app_localizations_zh.dart@@ -2953,6 +2953,13 @@ class AppLocalizationsZh extends AppLocalizations {@overrideString get ebookOnlyNoAudio => '仅电子书 - 无音频';+ @override+ String get absorbAudioNotDownloaded => 'Audio not downloaded';++ @override+ String get absorbAudioNotDownloadedEbookOnly =>+ 'Audio not downloaded, ebook only';+@overrideString get fullyAbsorbed => '已完成';@@ -3910,6 +3917,16 @@ class AppLocalizationsZh extends AppLocalizations {@overrideString get showExplicitBadgeOffSubtitle => '关闭 - 隐藏敏感内容标记';+ @override+ String get showEbookBadge => 'Show ebook badge';++ @override+ String get showEbookBadgeOnSubtitle =>+ 'Books with an ebook show a book icon on the cover';++ @override+ String get showEbookBadgeOffSubtitle => 'Off - ebook badge hidden';+@overrideString get libraryFallback => 'Library';diff --git a/lib/main.dart b/lib/main.dartindex 8b5f54a4..d08d3cb1 100644--- a/lib/main.dart+++ b/lib/main.dart@@ -239,6 +239,7 @@ void main() async {snappyTransitionsNotifier.value = await PlayerSettings.getSnappyTransitions();classicWordingNotifier.value = await PlayerSettings.getClassicWording();PlayerSettings.showExplicitBadge = await PlayerSettings.getShowExplicitBadge();+ PlayerSettings.showEbookBadge = await PlayerSettings.getShowEbookBadge();PlayerSettings.mp3IndexSeeking = await PlayerSettings.getMp3IndexSeeking();PlayerSettings.coverSize = await PlayerSettings.getCoverSize();// Restore last cover seed color so the theme doesn't flash on startup@@ -716,6 +717,7 @@ class _AuthGateState extends State<AuthGate> {snappyTransitionsNotifier.value = await PlayerSettings.getSnappyTransitions();classicWordingNotifier.value = await PlayerSettings.getClassicWording();PlayerSettings.showExplicitBadge = await PlayerSettings.getShowExplicitBadge();+ PlayerSettings.showEbookBadge = await PlayerSettings.getShowEbookBadge();PlayerSettings.mp3IndexSeeking = await PlayerSettings.getMp3IndexSeeking();PlayerSettings.coverSize = await PlayerSettings.getCoverSize();// Rotation lock: main() applied it before scope was active, so that passdiff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dartindex 1af410ea..62381874 100644--- a/lib/providers/auth_provider.dart+++ b/lib/providers/auth_provider.dart@@ -1310,6 +1310,7 @@ class AuthProvider extends ChangeNotifier {// values until restart.PlayerSettings.showExplicitBadge =await PlayerSettings.getShowExplicitBadge();+ PlayerSettings.showEbookBadge = await PlayerSettings.getShowEbookBadge();PlayerSettings.mp3IndexSeeking = await PlayerSettings.getMp3IndexSeeking();PlayerSettings.coverSize = await PlayerSettings.getCoverSize();diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dartindex 8e44980a..ba666f18 100644--- a/lib/screens/settings_screen.dart+++ b/lib/screens/settings_screen.dart@@ -147,6 +147,7 @@ class _SettingsScreenState extends State<SettingsScreen> {bool _hideEbookOnly = false;bool _showGoodreadsButton = false;bool _showExplicitBadge = true;+ bool _showEbookBadge = true;bool _loggingEnabled = false;bool _fullScreenPlayer = false;bool _lockPortrait = false;@@ -1001,6 +1002,7 @@ class _SettingsScreenState extends State<SettingsScreen> {final coverSize = await PlayerSettings.getCoverSize();final flatBackground = await PlayerSettings.getFlatBackground();final showSubtitles = await PlayerSettings.getShowSubtitles();+ final showEbookBadge = await PlayerSettings.getShowEbookBadge();final einkMode = await PlayerSettings.getEinkMode();final colorSource = await PlayerSettings.getColorSource();final manualSeed = await PlayerSettings.getManualSeedColor();@@ -1169,6 +1171,7 @@ class _SettingsScreenState extends State<SettingsScreen> {_longBackSkip = longBack;_trustAllCerts = trustCerts;_showExplicitBadge = showExplicit;+ _showEbookBadge = showEbookBadge;_includePreReleases = preReleases;_sleepFadeDuration = fadeDur;_sleepChime = chime;@@ -3889,6 +3892,20 @@ class _SettingsScreenState extends State<SettingsScreen> {PlayerSettings.setShowExplicitBadge(v);} : null,),+ const Divider(height: 1, indent: 16, endIndent: 16),+ SwitchListTile(+ title: Text(l.showEbookBadge),+ subtitle: Text(+ _showEbookBadge+ ? l.showEbookBadgeOnSubtitle+ : l.showEbookBadgeOffSubtitle,+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant)),+ value: _showEbookBadge,+ onChanged: _loaded ? (v) {+ setState(() => _showEbookBadge = v);+ PlayerSettings.setShowEbookBadge(v);+ } : null,+ ),if (lib.libraries.length > 1) ...[const Divider(height: 1, indent: 16, endIndent: 16),...lib.librariesdiff --git a/lib/screens/settings_search_index.dart b/lib/screens/settings_search_index.dartindex 242f9825..ca40b3be 100644--- a/lib/screens/settings_search_index.dart+++ b/lib/screens/settings_search_index.dart@@ -121,6 +121,7 @@ List<SettingSearchEntry> settingsSearchEntries(BuildContext context) {SettingSearchEntry('Library', l.sectionLibrary, l.hideEbookOnlyTitles, [l.hideEbookOnlyOnSubtitle, l.hideEbookOnlyOffSubtitle]),SettingSearchEntry('Library', l.sectionLibrary, l.showGoodreadsButton, [l.showGoodreadsOnSubtitle, l.showGoodreadsOffSubtitle]),SettingSearchEntry('Library', l.sectionLibrary, l.showExplicitBadge, [l.showExplicitBadgeOnSubtitle, l.showExplicitBadgeOffSubtitle]),+ SettingSearchEntry('Library', l.sectionLibrary, l.showEbookBadge, [l.showEbookBadgeOnSubtitle, l.showEbookBadgeOffSubtitle]),SettingSearchEntry('Library', l.sectionLibrary, l.coverShapeLabel, [l.coverShapeDefault, l.coverShapeSquare, l.coverShapeRectangle]),SettingSearchEntry('Library', l.sectionLibrary, l.subtitleVisibilityLabel, [l.subtitleVisibilityDefault, l.subtitleVisibilityShow, l.subtitleVisibilityHide]),SettingSearchEntry('Library', l.sectionLibrary, l.currentLibrarySkipOverride, [l.currentLibrarySkipOverrideOnSubtitle, l.currentLibrarySkipOverrideOffSubtitle]),diff --git a/lib/services/backup_service.dart b/lib/services/backup_service.dartindex 7f22e3cd..0c99b4df 100644--- a/lib/services/backup_service.dart+++ b/lib/services/backup_service.dart@@ -112,6 +112,7 @@ class BackupService {'sectionGridView': await PlayerSettings.getSectionGridView(),'collapseBookSeries': await PlayerSettings.getCollapseBookSeries(),'showExplicitBadge': await PlayerSettings.getShowExplicitBadge(),+ 'showEbookBadge': await PlayerSettings.getShowEbookBadge(),'includePreReleases': await PlayerSettings.getIncludePreReleases(),'language': await PlayerSettings.getLanguage(),'showUpNextLabel': await PlayerSettings.getShowUpNextLabel(),@@ -637,6 +638,7 @@ class BackupService {if (s['sectionGridView'] != null) await PlayerSettings.setSectionGridView(s['sectionGridView'] as bool);if (s['collapseBookSeries'] != null) await PlayerSettings.setCollapseBookSeries(s['collapseBookSeries'] as bool);if (s['showExplicitBadge'] != null) await PlayerSettings.setShowExplicitBadge(s['showExplicitBadge'] as bool);+ if (s['showEbookBadge'] != null) await PlayerSettings.setShowEbookBadge(s['showEbookBadge'] as bool);if (s['includePreReleases'] != null) await PlayerSettings.setIncludePreReleases(s['includePreReleases'] as bool);if (s['language'] != null) await PlayerSettings.setLanguage(s['language'] as String);if (s['showUpNextLabel'] != null) await PlayerSettings.setShowUpNextLabel(s['showUpNextLabel'] as bool);diff --git a/lib/services/ebook_cache.dart b/lib/services/ebook_cache.dartindex d5c0416b..e4bf4078 100644--- a/lib/services/ebook_cache.dart+++ b/lib/services/ebook_cache.dart@@ -50,6 +50,16 @@ Map<String, dynamic>? resolveEbookFile(Map<String, dynamic>? item) {return firstReadable ?? firstEbook;}+/// Whether a library item comes with an ebook, from the full item or from+/// the minified list form, which only carries the format.+bool hasEbookFile(Map<String, dynamic>? item) {+ if (item == null) return false;+ if (resolveEbookFile(item) != null) return true;+ final media = item['media'] as Map<String, dynamic>?;+ final fmt = media?['ebookFormat'];+ return fmt is String && fmt.isNotEmpty;+}+Directory? _ebookCacheDirHandle;Future<Directory> _ebookCacheDir() async {diff --git a/lib/services/player_settings.dart b/lib/services/player_settings.dartindex 1aa674a6..c5baac3d 100644--- a/lib/services/player_settings.dart+++ b/lib/services/player_settings.dart@@ -815,6 +815,13 @@ class PlayerSettings {await _set('showExplicitBadge', value);}+ static bool showEbookBadge = true;+ static Future<bool> getShowEbookBadge() => _get('showEbookBadge', true);+ static Future<void> setShowEbookBadge(bool value) async {+ showEbookBadge = value;+ await _set('showEbookBadge', value, notify: true);+ }+/// Cached value for synchronous access when building audio sources.static bool mp3IndexSeeking = false;static Future<bool> getMp3IndexSeeking() => _get('mp3IndexSeeking', false);diff --git a/lib/widgets/book_card.dart b/lib/widgets/book_card.dartindex c4e45d89..0080e401 100644--- a/lib/widgets/book_card.dart+++ b/lib/widgets/book_card.dart@@ -4,6 +4,7 @@ import 'package:provider/provider.dart';import 'package:cached_network_image/cached_network_image.dart';import '../l10n/app_localizations.dart';import 'cover_badges.dart';+import '../services/ebook_cache.dart';import '../providers/library_provider.dart';import '../services/audio_player_service.dart';import '../services/download_service.dart';@@ -62,6 +63,7 @@ class BookCard extends StatelessWidget {final isFinished = lib.getProgressData(itemId)?['isFinished'] == true;final isExplicit = PlayerSettings.showExplicitBadge && metadata['explicit'] == true;final isDownloaded = DownloadService().isDownloaded(itemId ?? '');+ final hasEbook = PlayerSettings.showEbookBadge && hasEbookFile(item);// Only compute for podcast shows that aren't being rendered as an episode// (an episode card shows the recentEpisode payload, not show-level info).final unfinishedCount = (lib.isPodcastLibrary && item['recentEpisode'] == null)@@ -71,8 +73,8 @@ class BookCard extends StatelessWidget {final headers = lib.mediaHeaders;final card = isWide- ? _buildWideCard(context, cs, tt, l, title, authorName, coverUrl, progress, headers, isExplicit: isExplicit)- : _buildCompactCard(context, cs, tt, l, title, subtitle, authorName, coverUrl, progress, headers, isFinished: isFinished, isDownloaded: isDownloaded, isExplicit: isExplicit, unfinishedCount: unfinishedCount);+ ? _buildWideCard(context, cs, tt, l, title, authorName, coverUrl, progress, headers, isExplicit: isExplicit, hasEbook: hasEbook)+ : _buildCompactCard(context, cs, tt, l, title, subtitle, authorName, coverUrl, progress, headers, isFinished: isFinished, isDownloaded: isDownloaded, isExplicit: isExplicit, unfinishedCount: unfinishedCount, hasEbook: hasEbook);if (!selectionMode) return card;// Selection sits on top of the finished card rather than inside both// layouts: the overlay swallows the tap, so nothing below it can open a@@ -200,6 +202,7 @@ class BookCard extends StatelessWidget {double progress,Map<String, String> headers, {bool isExplicit = false,+ bool hasEbook = false,}) {return Card(elevation: 0,@@ -219,6 +222,8 @@ class BookCard extends StatelessWidget {child: Stack(children: [_CoverImage(coverUrl: coverUrl, cs: cs, fit: BoxFit.contain, httpHeaders: headers, title: title, author: authorName),+ if (hasEbook && !selectionMode)+ const Positioned(top: 4, left: 4, child: EbookCoverBadge()),if (isExplicit)Positioned(top: 4, right: DownloadService().isDownloaded(item['id'] as String? ?? '') ? 30 : 4,@@ -319,6 +324,7 @@ class BookCard extends StatelessWidget {bool isDownloaded = false,bool isExplicit = false,int unfinishedCount = 0,+ bool hasEbook = false,}) {return Column(crossAxisAlignment: CrossAxisAlignment.start,@@ -394,6 +400,8 @@ class BookCard extends StatelessWidget {),),),+ if (hasEbook && !selectionMode)+ const Positioned(top: 4, left: 4, child: EbookCoverBadge()),if (isFinished || isDownloaded)Positioned(left: 0, right: 0, bottom: 0,diff --git a/lib/widgets/book_detail_sheet.dart b/lib/widgets/book_detail_sheet.dartindex 62a329b7..800be5d1 100644--- a/lib/widgets/book_detail_sheet.dart+++ b/lib/widgets/book_detail_sheet.dart@@ -899,6 +899,33 @@ class _BookDetailSheetContentState extends State<_BookDetailSheetContent> {// How far into the book you are fills the button from the left,// the way the download button fills while it fetches.final showFill = progress > 0 && !isFinished;+ // Offline with nothing to play: only the ebook may be on the+ // phone, and the Read button below still works.+ if (lib.isOffline &&+ !showAbsorbingState &&+ !DownloadService().isDownloaded(widget.itemId)) {+ return Material(+ color: accent.withValues(alpha: 0.4),+ borderRadius: BorderRadius.circular(16),+ child: Center(+ child: Row(mainAxisSize: MainAxisSize.min, children: [+ Icon(Icons.cloud_off_rounded, size: 22, color: onAccent),+ const SizedBox(width: 8),+ Flexible(+ child: Text(+ ebookFile != null && canReadEbook(ebookFile)+ ? l.absorbAudioNotDownloadedEbookOnly+ : l.absorbAudioNotDownloaded,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: tt.titleMedium+ ?.copyWith(fontWeight: FontWeight.w600, color: onAccent),+ ),+ ),+ ]),+ ),+ );+ }return Material(color: accent,diff --git a/lib/widgets/cover_badges.dart b/lib/widgets/cover_badges.dartindex b3484444..ae5de456 100644--- a/lib/widgets/cover_badges.dart+++ b/lib/widgets/cover_badges.dart@@ -99,3 +99,21 @@ class CoverStateBadges extends StatelessWidget {);}}++/// Small book icon for a cover corner, on books that come with an ebook:+/// Positioned(top: 4, left: 4, child: EbookCoverBadge())+class EbookCoverBadge extends StatelessWidget {+ const EbookCoverBadge({super.key});++ @override+ Widget build(BuildContext context) {+ return Container(+ padding: const EdgeInsets.all(3),+ decoration: BoxDecoration(+ color: Colors.black.withValues(alpha: 0.6),+ shape: BoxShape.circle,+ ),+ child: const Icon(Icons.menu_book_rounded, size: 11, color: Colors.white),+ );+ }+}diff --git a/lib/widgets/home_section.dart b/lib/widgets/home_section.dartindex 06cc3cc8..decc2535 100644--- a/lib/widgets/home_section.dart+++ b/lib/widgets/home_section.dart@@ -60,11 +60,13 @@ class HomeSection extends StatelessWidget {? null: _collectionNameFromTitle(title);- // Check if any entities have recentEpisode (podcast episode sections)- final hasEpisodeEntities = !isEpisodeSection && entities.isNotEmpty &&- entities.first is Map<String, dynamic> &&- (entities.first as Map<String, dynamic>)['recentEpisode'] != null;- final effectiveEpisode = isEpisodeSection || hasEpisodeEntities;+ // A shelf of nothing but episodes keeps the episode layout. The Downloads+ // shelf can mix episodes with books, and then it is sized for the books+ // so their covers follow the cover size and the author line fits.+ final onlyEpisodeEntities = !isEpisodeSection && entities.isNotEmpty &&+ entities.every((e) =>+ e is Map<String, dynamic> && e['recentEpisode'] != null);+ final effectiveEpisode = isEpisodeSection || onlyEpisodeEntities;final bool isRectCover = coverAspectRatio < 1.0;// Book and series covers follow the cover size setting like the library@@ -82,16 +84,23 @@ class HomeSection extends StatelessWidget {// cards have no subtitle to show, so they stay as they are.final bool subtitleLine =showSubtitles && !isContinueListening && !effectiveEpisode && !isAuthorSection;- final double cardHeight =- (isContinueListening- ? 120- : effectiveEpisode- ? 200- : isAuthorSection- ? 170- : (isRectCover ? 260 : 200) +- (cardWidth - 140) / coverAspectRatio) +- (subtitleLine ? 18 : 0);+ // The text under a cover card is measured from the theme and the system+ // font size, so the author line is never cut off when the title wraps or+ // a subtitle is shown.+ final scaler = MediaQuery.textScalerOf(context);+ double lineHeight(TextStyle? style) =>+ scaler.scale((style?.fontSize ?? 12) * (style?.height ?? 1.4));+ final double textBlock = 6 ++ lineHeight(tt.labelMedium) * (isRectCover ? 1 : 2) ++ lineHeight(tt.labelSmall) * (subtitleLine ? 2 : 1) ++ 6;+ final double cardHeight = isContinueListening+ ? 120+ : effectiveEpisode+ ? 200+ : isAuthorSection+ ? 170+ : cardWidth / coverAspectRatio + textBlock;return Padding(padding: const EdgeInsets.only(top: 24),diff --git a/lib/widgets/library_grid_tiles.dart b/lib/widgets/library_grid_tiles.dartindex fa073cc0..6ac8d692 100644--- a/lib/widgets/library_grid_tiles.dart+++ b/lib/widgets/library_grid_tiles.dart@@ -8,6 +8,7 @@ import '../providers/auth_provider.dart';import '../providers/library_provider.dart';import '../services/audio_player_service.dart';import '../services/download_service.dart';+import '../services/ebook_cache.dart';import 'absorbing_shared.dart';import 'book_detail_sheet.dart';import 'books_sheet_shared.dart' show coverGridTextScale, coverGridDecodeWidth;@@ -79,6 +80,7 @@ class _GridBookTileState extends State<GridBookTile> {final progress = lib.getProgress(itemId);final isExplicit = PlayerSettings.showExplicitBadge && metadata['explicit'] == true;final isDownloaded = _dl.isDownloaded(itemId);+ final hasEbook = PlayerSettings.showEbookBadge && hasEbookFile(widget.item);final isFinished = lib.getProgressData(itemId)?['isFinished'] == true;final isSubscribed = lib.isPodcastLibrary && lib.isPodcastSubscribed(itemId);final unfinishedCount =@@ -194,6 +196,12 @@ class _GridBookTileState extends State<GridBookTile> {),),+ if (hasEbook && !widget.selectionMode)+ Positioned(+ top: widget.sequenceBadge != null ? 24 : 4, left: 4,+ child: const EbookCoverBadge(),+ ),+// Sequence badgeif (widget.sequenceBadge != null)Positioned(