Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Remember the Shows or Episodes view on the podcast page

Barnabasfddcf886a787
diff --git a/lib/screens/library_screen.dart b/lib/screens/library_screen.dart
index 37da48b3..10f87c92 100644
--- a/lib/screens/library_screen.dart
+++ b/lib/screens/library_screen.dart
@@ -670,6 +670,7 @@ class LibraryScreenState extends State<LibraryScreen>
PlayerSettings.getPodcastTagFilter(),
PlayerSettings.getPodcastFilterValue(),
PlayerSettings.getPodcastFilterValueLabel(),
+ PlayerSettings.getPodcastView(),
]);
if (!mounted) return;
final sortName = results[0] as String;
@@ -819,6 +820,11 @@ class LibraryScreenState extends State<LibraryScreen>
_currentTab = savedTab;
_tabController?.animateTo(savedTab);
}
+ // Podcast libraries: restore the Shows/Episodes pill the same way
+ // book libraries restore their tab.
+ if (isPodcast) {
+ _podcastView = (results.last as int) == 1 ? 1 : 0;
+ }
});
// Lazy load data for the restored tab
if (!isPodcast &&
@@ -2752,6 +2758,7 @@ class LibraryScreenState extends State<LibraryScreen>
onTap: () {
if (!active) {
setState(() => _podcastView = i);
+ PlayerSettings.setPodcastView(i);
} else if (i == 0) {
// Re-tap on the active Shows pill opens the sort sheet,
// same as the book libraries' pills.
diff --git a/lib/services/player_settings.dart b/lib/services/player_settings.dart
index 158b9460..c48a4bd2 100644
--- a/lib/services/player_settings.dart
+++ b/lib/services/player_settings.dart
@@ -610,6 +610,10 @@ class PlayerSettings {
static Future<int> getLibraryTab() => _get('libraryTab', 0);
static Future<void> setLibraryTab(int value) => _set('libraryTab', value);
+ /// Podcast library view: 0 = Shows grid, 1 = Episodes feed.
+ static Future<int> getPodcastView() => _get('podcastView', 0);
+ static Future<void> setPodcastView(int value) => _set('podcastView', value);
+
// ── Podcast library sort persistence ──
static Future<String> getPodcastSort() => _get('podcastSort', 'recentlyAdded');