Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Bring the desktop branch up to date with the web branch

Barnabasfdf1f5118d56
diff --cc lib/main.dart
index 6caf09b3,73d238ff..d887b24b
--- a/lib/main.dart
+++ b/lib/main.dart
@@@ -206,7 -211,14 +211,14 @@@ Future<void> applyOrientationLock() asy
void main() async {
if (!AppPlatform.isWeb) HttpOverrides.global = _CertOverrides();
final widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
+ ReadListenSync.instance.start();
+ BookOrbitApiService.placeReadingSpot = NarrationService.readingSpotSeconds;
+ BookOrbitApiService.keptNarration = NarrationService.instance.localOverlay;
+ ApiService.pageReadElsewhere = NarrationService.pageReadElsewhere;
+ try {
+ await NarratedBooks.load().timeout(const Duration(seconds: 2));
+ } catch (_) {}
- final setupLinkStream = AppPlatform.isWeb ? null : AppLinks().uriLinkStream;
+ final setupLinkStream = AppPlatform.lacksPhonePlugins ? null : AppLinks().uriLinkStream;
// These calls use platform channels that require an Activity. When Android
// Auto cold-starts the app for the MediaBrowserService, no Activity exists
diff --cc lib/providers/auth_provider.dart
index b11e7867,2aa62519..47e02333
--- a/lib/providers/auth_provider.dart
+++ b/lib/providers/auth_provider.dart
@@@ -424,6 -479,56 +479,56 @@@ class AuthProvider extends ChangeNotifi
);
}
+ /// The session ran out: keep the account and the app running, drop the
+ /// tokens, and carry on with what is on the phone. Playback keeps going;
+ /// listening queues like offline and goes up after the next sign-in.
+ Future<void> _signOutKeepingAccount() async {
+ final server = _serverUrl;
+ final user = _username;
+ _accessToken = null;
+ _refreshToken = null;
+ _isLegacyToken = false;
+ _userJson = null;
+ _signedOut = true;
+ AudioPlayerService().useApi(SignedOutPlayback.api());
+ SignedOutPlayback.started();
- if (!AppPlatform.isWeb) {
++ if (!AppPlatform.lacksPhonePlugins) {
+ AndroidAutoService().clearCache();
+ CarPlayService().clearAndRefresh();
+ WearAuthService.instance.clear();
+ }
+ BookOrbitApiService.clearCaches();
+ try {
+ if (server != null && user != null) {
+ await UserAccountService().clearTokens(server, user);
+ }
+ final prefs = await SharedPreferences.getInstance();
+ await prefs.remove('token');
+ await prefs.remove('refresh_token');
+ } catch (e) {
+ debugPrint('[Auth] Clearing the expired session failed: $e');
+ }
+ notifyListeners();
+ }
+
+ /// Open the app signed out on [account], whose session already ended, to
+ /// listen to what is on the phone (the sign-in screen's play downloads).
+ void continueSignedOut(SavedAccount account) {
+ _serverUrl = account.serverUrl;
+ _username = account.username;
+ _userId = account.userId;
+ _customHeaders = account.customHeaders;
+ _backend = account.backend;
+ _useLocalServer = false;
+ _accessToken = null;
+ _refreshToken = null;
+ _userJson = null;
+ _signedOut = true;
+ SignedOutPlayback.started();
+ debugPrint('[Auth] Continuing signed out as ${account.username}@${account.serverUrl}');
+ notifyListeners();
+ }
+
/// Try to restore a saved session from SharedPreferences.
/// If the server is unreachable, still restore credentials so offline mode works.
Future<void> tryRestoreSession() async {
@@@ -824,13 -920,17 +920,17 @@@
userId: _userId,
isLegacyToken: _isLegacyToken,
customHeaders: customHeaders,
+ backend: _backend,
),
);
- } catch (_) {}
+ } catch (e) {
+ debugPrint('[Auth] Saving the account failed: $e');
+ }
await _onAccountActivated();
+ await apiService?.ensureMediaReady();
- if (!AppPlatform.isWeb) {
+ if (!AppPlatform.lacksPhonePlugins) {
await HomeWidgetService().clearStats();
HomeWidgetService().refreshStats(force: true);
_pushSessionToWear();
@@@ -1030,13 -1179,17 +1179,17 @@@
userId: _userId,
isLegacyToken: _isLegacyToken,
customHeaders: customHeaders,
+ backend: _backend,
),
);
- } catch (_) {}
+ } catch (e) {
+ debugPrint('[Auth] Saving the account failed: $e');
+ }
await _onAccountActivated();
+ await apiService?.ensureMediaReady();
- if (!AppPlatform.isWeb) {
+ if (!AppPlatform.lacksPhonePlugins) {
await HomeWidgetService().clearStats();
HomeWidgetService().refreshStats(force: true);
_pushSessionToWear();
diff --cc lib/providers/library_provider.dart
index 5711ee25,177564c7..4d6c3e22
--- a/lib/providers/library_provider.dart
+++ b/lib/providers/library_provider.dart
@@@ -207,8 -232,14 +232,14 @@@ class LibraryProvider extends ChangeNot
_buildProgressMap(auth);
- if (!AppPlatform.isWeb && !auth.serverReachable) {
+ if (!AppPlatform.lacksPhonePlugins && !auth.serverReachable) {
- debugPrint('[Library] Server not reachable — going offline');
+ debugPrint(
+ '[Library] Server not reachable — going offline with ${_libraries.length} libraries '
+ '(fromCache=$_librariesFromCache selected=$_selectedLibraryId)');
+ unawaited(PlayerSettings.getPodcastTabEnabled().then((on) async {
+ final tabLib = await PlayerSettings.getPodcastTabLibraryId();
+ debugPrint('[Library] Offline start: podcast tab=$on library=$tabLib');
+ }));
_networkOffline = true;
_buildOfflineSections();
_isLoading = false;
@@@ -429,8 -514,12 +514,12 @@@
await _rememberBookLibrary(libraryId);
await _loadSectionPrefs();
notifyListeners();
+ // The shelves can come from the cache without a fetch, and playlists
+ // and collections were just cleared, so they load either way.
+ unawaited(loadPlaylists());
+ unawaited(loadCollections());
await loadPersonalizedView();
- if (!AppPlatform.isWeb) {
+ if (!AppPlatform.lacksPhonePlugins) {
AndroidAutoService().refresh(force: true);
CarPlayService().refreshTemplates();
}
diff --cc lib/screens/app_shell.dart
index 9508f93a,acdf9efb..89b358a8
--- a/lib/screens/app_shell.dart
+++ b/lib/screens/app_shell.dart
@@@ -526,8 -564,10 +564,10 @@@ class _AppShellState extends State<AppS
void initState() {
super.initState();
_instance = this;
+ _incomingNotifications =
+ BookOrbitNotificationSocket.instance.incoming.listen(showIncomingNotificationToast);
EreaderVolumeNav.ensureHandler();
- if (AppPlatform.isWeb) {
+ if (AppPlatform.lacksPhonePlugins) {
_serverTaskTracker = ServerTaskTracker();
_serverUpdateController.addListener(_onServerUpdateChanged);
}
@@@ -537,7 -577,8 +577,8 @@@
_onDesktopExitGuardChanged,
);
unawaited(_loadDesktopSidebarPreference());
- if (!AppPlatform.isWeb) PlayerScreenWake.start();
- if (AppPlatform.isWeb) {
++ if (!AppPlatform.lacksPhonePlugins) PlayerScreenWake.start();
+ if (AppPlatform.lacksPhonePlugins) {
_currentIndex = 0;
} else if (!widget.startOnAbsorbing) {
_loadStartScreen();
@@@ -562,7 -604,7 +604,7 @@@
context.read<LibraryProvider>().addListener(_onLibraryChanged);
_loadPodcastTabPrefs();
PlayerSettings.settingsChanged.addListener(_loadPodcastTabPrefs);
- if (!AppPlatform.lacksPhonePlugins) WelcomeSheet.showIfNeeded(context);
- if (!AppPlatform.isWeb) _showLaunchPrompts();
++ if (!AppPlatform.lacksPhonePlugins) _showLaunchPrompts();
_checkForUpdate();
}
diff --cc lib/screens/chapter_editor_screen.dart
index 972d7c85,d3d32438..960f228d
--- a/lib/screens/chapter_editor_screen.dart
+++ b/lib/screens/chapter_editor_screen.dart
@@@ -1370,7 -1769,7 +1770,7 @@@ class _ChapterEditBodyState extends Sta
final contentUrl = track['contentUrl'] as String?;
if (contentUrl == null) return;
source = api.buildTrackUrl(contentUrl);
- if (Platform.isIOS || Platform.isWindows) {
- if (AppPlatform.isIOS) {
++ if (AppPlatform.isIOS || AppPlatform.isWindows) {
remote = RemoteTrack(
url: source,
headers: api.mediaHeaders,
diff --cc lib/screens/home_screen.dart
index 146b70cc,127cf36c..42b925a0
--- a/lib/screens/home_screen.dart
+++ b/lib/screens/home_screen.dart
@@@ -344,8 -359,127 +359,127 @@@ class HomeScreenState extends State<Hom
}
}
+ /// A heading that opens the whole shelf, over a row of big cover cards.
+ /// Reading cards open the reader instead of playing.
+ List<Widget> _heroShelf({
+ required LibraryProvider lib,
+ required String title,
+ required IconData icon,
+ required List<dynamic> items,
+ required bool reading,
+ required bool selectionAvailable,
+ }) {
+ if (items.isEmpty) return const <Widget>[];
+ final cs = Theme.of(context).colorScheme;
+ final tt = Theme.of(context).textTheme;
+ final desktop = isDesktopWorkspace(context);
+ final desktopCardWidth = 180 * (_bookshelfCoverSize / 120);
+ Widget card(Map<String, dynamic> item) => RepaintBoundary(
+ child: _ContinueListeningCard(
+ item: item,
+ lib: lib,
+ player: _player,
+ rectangleCovers: _rectangleCovers,
+ desktopWidth: desktop ? desktopCardWidth : 180,
+ reading: reading,
+ tapOpensDetails: _cardsOpenDetails,
+ selectionMode: selectionAvailable && _selectionMode,
+ selected: _selectedItemIds.contains(item['id'] as String?),
+ onSelectionToggle:
+ selectionAvailable &&
+ item['recentEpisode'] == null &&
+ item['id'] is String
+ ? () => _toggleSelection(item)
+ : null,
+ ),
+ );
+ return <Widget>[
+ SliverToBoxAdapter(
+ child: GestureDetector(
+ onTap: _selectionMode
+ ? null
+ : () => SectionDetailSheet.show(
+ context,
+ title: title,
+ icon: icon,
+ entities: items,
+ coverAspectRatio: _rectangleCovers ? 2 / 3 : 1.0,
+ ),
+ behavior: HitTestBehavior.opaque,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(20, 24, 20, 0),
+ child: Row(
+ children: [
+ Icon(icon, size: 16, color: cs.primary.withValues(alpha: 0.7)),
+ const SizedBox(width: 8),
+ Text(
+ title,
+ style: tt.titleSmall?.copyWith(
+ fontWeight: FontWeight.w500,
+ color: cs.onSurface.withValues(alpha: 0.8),
+ letterSpacing: 0.3,
+ ),
+ ),
+ const SizedBox(width: 4),
+ Icon(
+ Icons.chevron_right_rounded,
+ size: 16,
+ color: cs.onSurfaceVariant.withValues(alpha: 0.4),
+ ),
+ const SizedBox(width: 12),
+ Expanded(
+ child: Container(
+ height: 0.5,
+ color: cs.outlineVariant.withValues(alpha: 0.2),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
- if (!reading && !_cardsOpenDetails && !desktop && !AppPlatform.isWeb)
++ if (!reading && !_cardsOpenDetails && !desktop && !AppPlatform.lacksPhonePlugins)
+ const SliverToBoxAdapter(
+ child: FeatureHint(
+ prefKey: 'hint_continue_listening_gestures',
+ message: 'Tap a card to resume. Press and hold to see details.',
+ ),
+ ),
+ SliverToBoxAdapter(
+ child: Padding(
+ padding: const EdgeInsets.only(top: 12),
+ child: SizedBox(
+ // Taller row when 2:3 covers are on; the card's
+ // cover alone is ~225 with rectangle covers.
+ height:
+ (_rectangleCovers ? 320 : 250) *
+ (desktop ? _desktopShelfScale : 1.0),
+ child: desktop
+ ? SnapScrollList(
+ cardWidth: desktopCardWidth,
+ desktop: true,
+ itemCount: items.length,
+ itemBuilder: (context, i) =>
+ card(items[i] as Map<String, dynamic>),
+ )
+ : ListView.separated(
+ scrollDirection: Axis.horizontal,
+ padding: const EdgeInsets.symmetric(horizontal: 20),
+ physics: const BouncingScrollPhysics(),
+ itemCount: items.length,
+ separatorBuilder: (_, __) => const SizedBox(width: 10),
+ itemBuilder: (context, i) =>
+ card(items[i] as Map<String, dynamic>),
+ ),
+ ),
+ ),
+ ),
+ ];
+ }
+
static const _sectionIcons = {
'continue-listening': Icons.play_circle_outline_rounded,
+ 'continue-reading': Icons.menu_book_rounded,
'continue-series': Icons.auto_stories_rounded,
'recently-added': Icons.new_releases_outlined,
'listen-again': Icons.replay_rounded,
@@@ -938,21 -956,38 +956,38 @@@
selectedCount: _selectedItemIds.length,
selectableCount: selectableHomeItems.length,
busy: _batchActionBusy,
+ busyLabel: _bookMatchProgress,
canQuickMatch:
- context.watch<AuthProvider>().isAdmin &&
!lib.isPodcastLibrary &&
- !lib.isOffline,
+ !lib.isOffline &&
+ (auth.isAdmin ||
+ (auth.isBookOrbit &&
+ auth.canUpdateMetadata &&
+ lib.selectedLibraryId != ApiService.bookDockLibraryId)),
canMarkProgress: !lib.isPodcastLibrary,
- canDelete:
- context.watch<AuthProvider>().canDelete && !lib.isOffline,
+ canDelete: auth.canDelete && !lib.isOffline,
- canDownload: !AppPlatform.isWeb && !lib.isPodcastLibrary,
++ canDownload: !AppPlatform.lacksPhonePlugins && !lib.isPodcastLibrary,
onSelectAll: _toggleSelectAll,
onClear: _clearSelection,
- onQuickMatch: () => _runBatchAction(
- () => DesktopBatchActions.quickMatch(
+ onDownload: () => _runBatchAction(
+ () => DesktopBatchActions.download(
context,
- _selectedItemIds.toList(),
+ selectableHomeItems
+ .where((i) => _selectedItemIds.contains(i['id']))
+ .toList(),
),
),
+ onQuickMatch: () => _runBatchAction(() async {
+ final ok = await DesktopBatchActions.quickMatch(
+ context,
+ _selectedItemIds.toList(),
+ onProgress: (done, total) {
+ if (mounted) setState(() => _bookMatchProgress = '$done/$total');
+ },
+ );
+ if (mounted) setState(() => _bookMatchProgress = null);
+ return ok;
+ }),
onMarkFinished: () => _runBatchAction(
() => DesktopBatchActions.setFinished(
context,
diff --cc lib/screens/library_screen.dart
index e9b35e85,f271812d..8b982a41
--- a/lib/screens/library_screen.dart
+++ b/lib/screens/library_screen.dart
@@@ -24,6 -25,6 +25,7 @@@ import '../widgets/desktop_batch_action
import '../widgets/desktop_cover_size_control.dart';
import '../widgets/overlay_toast.dart';
import '../widgets/library_books_tab.dart';
++import '../utils/app_platform.dart';
import '../utils/desktop_workspace.dart';
import '../widgets/library_series_tab.dart';
import '../widgets/library_authors_tab.dart';
@@@ -2762,17 -2954,32 +2955,32 @@@ class LibraryScreenState extends State<
selectedCount: _selectedItemIds.length,
selectableCount: selectableCount,
busy: _batchActionBusy,
- canQuickMatch: auth.isAdmin && !libWatch.isPodcastLibrary,
+ busyLabel: _bookMatchProgress,
+ canQuickMatch: _canQuickMatchBooks(auth, libWatch),
canMarkProgress: !libWatch.isPodcastLibrary,
canDelete: auth.canDelete,
- canDownload: !kIsWeb && !libWatch.isPodcastLibrary,
++ canDownload: !AppPlatform.lacksPhonePlugins && !libWatch.isPodcastLibrary,
onSelectAll: _toggleSelectAll,
onClear: _clearSelection,
- onQuickMatch: () => _runBatchAction(
- () => DesktopBatchActions.quickMatch(
+ onDownload: () => _runBatchAction(
+ () => DesktopBatchActions.download(
context,
- _selectedItemIds.toList(),
+ _selectableVisibleItems()
+ .where((i) => _selectedItemIds.contains(i['id']))
+ .toList(),
),
),
+ onQuickMatch: () => _runBatchAction(() async {
+ final ok = await DesktopBatchActions.quickMatch(
+ context,
+ _selectedItemIds.toList(),
+ onProgress: (done, total) {
+ if (mounted) setState(() => _bookMatchProgress = '$done/$total');
+ },
+ );
+ if (mounted) setState(() => _bookMatchProgress = null);
+ return ok;
+ }),
onMarkFinished: () => _runBatchAction(
() => DesktopBatchActions.setFinished(
context,
diff --cc lib/screens/login_screen.dart
index 8395f93d,409a0add..07db906c
--- a/lib/screens/login_screen.dart
+++ b/lib/screens/login_screen.dart
@@@ -274,9 -287,12 +287,12 @@@ class _LoginScreenState extends State<L
}
});
- if (ok && !AppPlatform.isWeb) {
+ if (ok && !AppPlatform.lacksPhonePlugins) {
- OidcService.checkOidcEnabled(fullUrl, customHeaders: headers).then((config) {
- if (mounted && _resolvedServerUrl == fullUrl) {
+ final check = backend.isBookOrbit
+ ? OidcService.checkBookOrbitOidc(fullUrl, customHeaders: headers)
+ : OidcService.checkOidcEnabled(fullUrl, customHeaders: headers);
+ check.then((config) {
+ if (mounted && _resolvedServerUrl == fullUrl && _backend == backend) {
setState(() => _oidcConfig = config);
}
});
diff --cc lib/screens/settings_screen.dart
index 9fcd298d,8409c1f7..59354242
--- a/lib/screens/settings_screen.dart
+++ b/lib/screens/settings_screen.dart
@@@ -3219,6 -3558,146 +3558,146 @@@ class SettingsScreenState extends State
),
const SizedBox(height: 16),
+ // ── Car ──
- if (!AppPlatform.isWeb)
++ if (!AppPlatform.lacksPhonePlugins)
+ CollapsibleSection(
+ key: _keyFor('Car'),
+ icon: Icons.directions_car_rounded,
+ title: AppPlatform.isIOS ? l.sectionCarIos : l.sectionCar,
+ cs: cs,
+ isExpanded: _expandedSection == 'Car',
+ onExpansionChanged: (v) => _onSectionExpanded('Car', v),
+ children: [
+ SwitchListTile(
+ title: Text(AppPlatform.isIOS
+ ? l.carConnectAutoplayIos
+ : l.carConnectAutoplay),
+ subtitle: Text(
+ _autoplayOnCarConnect
+ ? l.carConnectAutoplayOnSubtitle
+ : l.carConnectAutoplayOffSubtitle,
+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant)),
+ value: _autoplayOnCarConnect,
+ onChanged: _loaded ? (v) {
+ setState(() => _autoplayOnCarConnect = v);
+ PlayerSettings.setAutoplayOnCarConnect(v);
+ } : null,
+ ),
+ const Divider(height: 1, indent: 16, endIndent: 16),
+ SwitchListTile(
+ title: Text(l.keepScreenOnCarMode),
+ subtitle: Text(l.keepScreenOnCarModeSubtitle,
+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant)),
+ value: _keepScreenOnCarMode,
+ onChanged: _loaded ? (v) {
+ setState(() => _keepScreenOnCarMode = v);
+ PlayerSettings.setKeepScreenOnInCarMode(v);
+ } : null,
+ ),
+ const Divider(height: 1, indent: 16, endIndent: 16),
+ _carSortPicker(
+ tt,
+ l.carBookOrder,
+ _carBookSort,
+ [('title', l.title), ('author', l.author), ('added', l.dateAdded)],
+ (v) {
+ setState(() => _carBookSort = v);
+ PlayerSettings.setCarBookSort(v)
+ .then((_) => AndroidAutoService.browseOrderChanged());
+ },
+ ),
+ SwitchListTile(
+ title: Text(l.carBookOrderReverse),
+ subtitle: Text(l.carBookOrderReverseSubtitle,
+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant)),
+ value: _carBookSortReverse,
+ onChanged: _loaded ? (v) {
+ setState(() => _carBookSortReverse = v);
+ PlayerSettings.setCarBookSortReverse(v)
+ .then((_) => AndroidAutoService.browseOrderChanged());
+ } : null,
+ ),
+ const Divider(height: 1, indent: 16, endIndent: 16),
+ _carSortPicker(
+ tt,
+ l.carPodcastOrder,
+ _carPodcastSort,
+ [('title', l.title), ('added', l.dateAdded)],
+ (v) {
+ setState(() => _carPodcastSort = v);
+ PlayerSettings.setCarPodcastSort(v)
+ .then((_) => AndroidAutoService.browseOrderChanged());
+ },
+ ),
+ SwitchListTile(
+ title: Text(l.carEpisodesOldestFirst),
+ subtitle: Text(l.carEpisodesOldestFirstSubtitle,
+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant)),
+ value: _carEpisodesOldestFirst,
+ onChanged: _loaded ? (v) {
+ setState(() => _carEpisodesOldestFirst = v);
+ PlayerSettings.setCarEpisodesOldestFirst(v)
+ .then((_) => AndroidAutoService.browseOrderChanged());
+ } : null,
+ ),
+ ],
+ ),
- if (!AppPlatform.isWeb) const SizedBox(height: 16),
++ if (!AppPlatform.lacksPhonePlugins) const SizedBox(height: 16),
+
+ if (AppPlatform.isIOS) ...[
+ // ── Siri ──
+ CollapsibleSection(
+ key: _keyFor('Siri'),
+ icon: Icons.mic_rounded,
+ title: l.sectionSiri,
+ cs: cs,
+ isExpanded: _expandedSection == 'Siri',
+ onExpansionChanged: (v) {
+ _onSectionExpanded('Siri', v);
+ if (v) _refreshSiriStatus();
+ },
+ children: [
+ ListTile(
+ title: Text(l.siriUseWithSiri),
+ subtitle: Text(
+ switch (_siriStatus) {
+ 'authorized' => l.siriStatusOn,
+ 'denied' || 'restricted' => l.siriStatusOff,
+ _ => l.siriStatusAsk,
+ },
+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant)),
+ trailing: _siriStatus == 'authorized'
+ ? Icon(Icons.check_circle_rounded, color: cs.primary)
+ : FilledButton.tonal(
+ onPressed: () async {
+ if (_siriStatus == 'notDetermined') {
+ await SiriService().requestAuthorization();
+ } else {
+ await SiriService().openSystemSettings();
+ }
+ await _refreshSiriStatus();
+ },
+ child: Text(_siriStatus == 'notDetermined'
+ ? l.siriAllow
+ : l.siriOpenSettings),
+ ),
+ ),
+ const Divider(height: 1, indent: 16, endIndent: 16),
+ ListTile(
+ title: Text(l.siriThingsToSay),
+ subtitle: Text(l.siriExamples,
+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant)),
+ ),
+ Padding(
+ padding: const EdgeInsets.fromLTRB(16, 0, 16, 12),
+ child: Text(l.siriShortcutsNote,
+ style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant)),
+ ),
+ ],
+ ),
+ const SizedBox(height: 16),
+ ],
+
// ── Sleep Timer ──
CollapsibleSection(
key: _keyFor('Sleep Timer'),
@@@ -3228,6 -3707,8 +3707,8 @@@
isExpanded: _expandedSection == 'Sleep Timer',
onExpansionChanged: (v) => _onSectionExpanded('Sleep Timer', v),
children: [
- // A browser has no motion sensor to shake.
- if (!AppPlatform.isWeb) ...[
++ // Browsers and computers have no motion sensor to shake.
++ if (!AppPlatform.lacksPhonePlugins) ...[
Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 4),
child: Text(l.shakeDuringSleepTimer, style: tt.bodyMedium?.copyWith(color: cs.onSurfaceVariant)),
@@@ -3309,7 -3791,7 +3791,7 @@@
),
// Shared by shake and button add-time modes, so it shows
// whenever either trigger needs it
- if (_shakeMode == 'addTime' || _sleepButtonMode == 'addTime') ...[
- if ((!AppPlatform.isWeb && _shakeMode == 'addTime') || _sleepButtonMode == 'addTime') ...[
++ if ((!AppPlatform.lacksPhonePlugins && _shakeMode == 'addTime') || _sleepButtonMode == 'addTime') ...[
const Divider(height: 1, indent: 16, endIndent: 16),
Padding(
padding: const EdgeInsets.fromLTRB(16, 12, 16, 4),
diff --cc lib/screens/settings_search_index.dart
index 6ae9e513,b67e9362..4bd4cf14
--- a/lib/screens/settings_search_index.dart
+++ b/lib/screens/settings_search_index.dart
@@@ -79,6 -77,24 +77,24 @@@ List<SettingSearchEntry> settingsSearch
SettingSearchEntry('Media Controls', l.sectionMediaControls, l.speedBookmarkInControls, [l.speedBookmarkOnSubtitle, l.speedBookmarkOffSubtitle]),
],
+ // ── Car ──
- if (!AppPlatform.isWeb) ...[
++ if (!AppPlatform.lacksPhonePlugins) ...[
+ SettingSearchEntry('Car', AppPlatform.isIOS ? l.sectionCarIos : l.sectionCar,
+ AppPlatform.isIOS ? l.carConnectAutoplayIos : l.carConnectAutoplay,
+ [l.carConnectAutoplayOnSubtitle, l.carConnectAutoplayOffSubtitle]),
+ SettingSearchEntry('Car', AppPlatform.isIOS ? l.sectionCarIos : l.sectionCar, l.keepScreenOnCarMode, [l.keepScreenOnCarModeSubtitle]),
+ SettingSearchEntry('Car', AppPlatform.isIOS ? l.sectionCarIos : l.sectionCar, l.carBookOrder, [l.title, l.author, l.dateAdded]),
+ SettingSearchEntry('Car', AppPlatform.isIOS ? l.sectionCarIos : l.sectionCar, l.carBookOrderReverse, [l.carBookOrderReverseSubtitle]),
+ SettingSearchEntry('Car', AppPlatform.isIOS ? l.sectionCarIos : l.sectionCar, l.carPodcastOrder, [l.title, l.dateAdded]),
+ SettingSearchEntry('Car', AppPlatform.isIOS ? l.sectionCarIos : l.sectionCar, l.carEpisodesOldestFirst, [l.carEpisodesOldestFirstSubtitle]),
+ ],
+
+ // ── Siri ──
+ if (AppPlatform.isIOS) ...[
+ SettingSearchEntry('Siri', l.sectionSiri, l.siriUseWithSiri, [l.siriStatusAsk, 'Shortcuts', 'voice']),
+ SettingSearchEntry('Siri', l.sectionSiri, l.siriThingsToSay, [l.siriExamples]),
+ ],
+
// ── Sleep Timer ──
SettingSearchEntry('Sleep Timer', l.sectionSleepTimer, l.shakeDuringSleepTimer, [l.shakeOff, l.shakeAddTime, l.shakeReset]),
SettingSearchEntry('Sleep Timer', l.sectionSleepTimer, l.shakeSensitivity, [l.shakeSensitivityVeryLow, l.shakeSensitivityLow, l.shakeSensitivityMedium, l.shakeSensitivityHigh, l.shakeSensitivityVeryHigh]),
diff --cc lib/widgets/book_detail_sheet.dart
index d652570a,65a0d547..65ac5001
--- a/lib/widgets/book_detail_sheet.dart
+++ b/lib/widgets/book_detail_sheet.dart
@@@ -1079,7 -1335,7 +1335,7 @@@ class _BookDetailSheetContentState exte
]),
),
)),
- if (!AppPlatform.lacksPhonePlugins && isEbookOnly && ebookFile != null && canReadEbook(ebookFile)) ...[
- if (!AppPlatform.isWeb && isEbookOnly && !_lookingForNarration && ebookFile != null && canReadEbook(ebookFile)) ...[
++ if (!AppPlatform.lacksPhonePlugins && isEbookOnly && !_lookingForNarration && ebookFile != null && canReadEbook(ebookFile)) ...[
const SizedBox(width: 8),
// For ebook-only books the big button above is already "Read", so this
// slot is the offline download (matching the audiobook download
@@@ -1430,10 -1988,12 +1988,12 @@@
]),
const SizedBox(height: 18),
// Primary actions: Absorb | Download side by side
- if (!isEbookOnly)
+ if (_lookingForNarration)
+ _lookingButton(accent, onAccent, height: 36, radius: 14)
+ else if (!isEbookOnly)
Row(children: [
Expanded(child: _quickAbsorbButton(context, cs, tt, auth, accent, onAccent, title, authorName, duration, chapters, isFinished, progress)),
- if (!AppPlatform.isWeb) ...[
+ if (!AppPlatform.lacksPhonePlugins) ...[
const SizedBox(width: 10),
Expanded(child: DownloadWideButton(itemId: widget.itemId, coverUrl: _coverUrl, title: title, author: authorName, accent: accent)),
],
@@@ -1524,11 -2080,11 +2080,11 @@@
// Save/Send push the file elsewhere, which needs the server's own file
// entry (with ino) - the cache-synthesized fallback can't serve them.
final serverEbookFile = resolveEbookFile(_item);
- if (!AppPlatform.isWeb && serverEbookFile != null) {
+ if (!AppPlatform.lacksPhonePlugins && serverEbookFile != null) {
add(_ebookSaved ? Icons.download_done_rounded : Icons.save_alt_rounded,
- l.ebookSaveToDevice, () => _saveEbook(context, auth, serverEbookFile, title));
+ l.ebookSaveToDevice, () => _saveEbook(context, auth, exportEbookFile(_item) ?? serverEbookFile, title));
}
- if (!AppPlatform.isWeb &&
+ if (!AppPlatform.lacksPhonePlugins &&
serverEbookFile != null &&
auth.ereaderDevices.isNotEmpty) {
add(Icons.send_to_mobile_rounded, l.sendToEreader, () => _sendToEreader(context, auth));
diff --cc lib/widgets/card_button_config.dart
index 95ae9a7f,a2c297d5..3824f8d9
--- a/lib/widgets/card_button_config.dart
+++ b/lib/widgets/card_button_config.dart
@@@ -56,16 -58,16 +58,16 @@@ String localizedCardButtonLabel(AppLoca
/// - F-Droid (GMS-free): Chromecast needs Google Play Services, so the stub
/// service reports castSupported=false and the button is dropped entirely.
final Set<String> _hiddenButtons = {
- if (AppPlatform.isWeb || AppPlatform.isIOS) 'cast',
+ if (AppPlatform.lacksPhonePlugins || AppPlatform.isIOS) 'cast',
if (!ChromecastService.castSupported) 'cast',
// AirPlay is iOS-only (Chromecast covers Android).
- if (AppPlatform.isWeb || !AppPlatform.isIOS) 'airplay',
- if (AppPlatform.isWeb) ...{
+ if (AppPlatform.lacksPhonePlugins || !AppPlatform.isIOS) 'airplay',
+ if (AppPlatform.lacksPhonePlugins) ...{
'car',
'download',
-- 'ebook',
'equalizer',
},
++ if (AppPlatform.isWeb) 'ebook',
};
const _allCardButtons = [
diff --cc lib/widgets/expanded_card.dart
index 96dc9fcb,8efd17ec..752c05e9
--- a/lib/widgets/expanded_card.dart
+++ b/lib/widgets/expanded_card.dart
@@@ -525,10 -527,10 +527,10 @@@ class _ExpandedCardState extends State<
final url = _coverUrl;
if (url == null) return;
final ImageProvider provider;
- if (!AppPlatform.isWeb && url.startsWith('/')) {
+ if (!AppPlatform.lacksPhonePlugins && url.startsWith('/')) {
provider = FileImage(File(url));
} else {
- provider = CachedNetworkImageProvider(url, headers: context.read<LibraryProvider>().mediaHeaders);
+ provider = CachedNetworkImageProvider(imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet, url, headers: context.read<LibraryProvider>().mediaHeaders);
}
_onCoverLoaded(provider);
}
diff --cc lib/widgets/series_books_sheet.dart
index ac220a31,2cf0b4c6..de97a792
--- a/lib/widgets/series_books_sheet.dart
+++ b/lib/widgets/series_books_sheet.dart
@@@ -1558,11 -1570,12 +1570,12 @@@ class _SeriesBooksSheetState extends St
final isExplicit = PlayerSettings.showExplicitBadge && metadata['explicit'] == true;
final progress = lib.getProgress(bookId);
final isFinished = lib.getProgressData(bookId)?['isFinished'] == true;
+ final isSkimmed = lib.getProgressData(bookId)?['skimmed'] == true;
final isDownloaded =
- !AppPlatform.isWeb && DownloadService().isDownloaded(bookId);
+ !AppPlatform.lacksPhonePlugins && DownloadService().isDownloaded(bookId);
final isDownloading =
- !AppPlatform.isWeb && DownloadService().isDownloading(bookId);
- final downloadPct = AppPlatform.isWeb
+ !AppPlatform.lacksPhonePlugins && DownloadService().isDownloading(bookId);
+ final downloadPct = AppPlatform.lacksPhonePlugins
? 0
: (DownloadService().downloadProgress(bookId) * 100)
.clamp(0, 100)
@@@ -1612,10 -1622,10 +1622,10 @@@
child: Stack(children: [
Positioned.fill(
child: coverUrl != null
- ? (!AppPlatform.isWeb && coverUrl.startsWith('/')
+ ? (!AppPlatform.lacksPhonePlugins && coverUrl.startsWith('/')
? Image.file(File(coverUrl), fit: BoxFit.cover,
errorBuilder: (_, __, ___) => _placeholder(cs))
- : CachedNetworkImage(
+ : CachedNetworkImage(imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
imageUrl: coverUrl, fit: BoxFit.cover,
httpHeaders: lib.mediaHeaders,
placeholder: (_, __) => _placeholder(cs),