Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Add more filters and improve login and session browsing

Barnabas003eb97f8eaf
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index ee828f36..c325fad4 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -164,12 +164,15 @@
"libraryTabAuthors": "Authors",
"libraryTabNarrators": "Narrators",
"libraryNoBooks": "No books found",
+ "libraryNoUnfinishedBooks": "No unfinished books",
"libraryNoBooksInProgress": "No books in progress",
"libraryNoFinishedBooks": "No finished books",
"libraryAllBooksStarted": "All books have been started",
"libraryNoDownloadedBooks": "No downloaded books",
"libraryNoSeriesFound": "No series found",
"libraryNoBooksWithEbooks": "No books with eBooks",
+ "libraryNoBooksMissingMetadata": "No books are missing this metadata",
+ "libraryNoItemsMatchingFilter": "No items match this filter",
"libraryNoBooksInGenre": "No books in \"{genre}\"",
"@libraryNoBooksInGenre": {
"placeholders": {
@@ -244,11 +247,26 @@
"duration": "Duration",
"random": "Random",
"collapseSeries": "Collapse Series",
+ "notFinished": "Not Finished",
"inProgress": "In Progress",
"filterFinished": "Finished",
"notStarted": "Not Started",
"downloaded": "Downloaded",
"hasEbook": "Has eBook",
+ "noEbook": "No eBook",
+ "hasSupplementaryEbook": "Has Supplementary eBook",
+ "noSupplementaryEbook": "No Supplementary eBook",
+ "noSeries": "No Series",
+ "publishedDecade": "Published Decade",
+ "tracks": "Tracks",
+ "noTracks": "No Tracks",
+ "singleTrack": "Single Track",
+ "multipleTracks": "Multiple Tracks",
+ "abridged": "Abridged",
+ "issues": "Issues",
+ "rssFeedOpen": "RSS Feed Open",
+ "explicitContent": "Explicit",
+ "missingMetadata": "Missing Metadata",
"genre": "Genre",
"tag": "Tag",
"clearFilter": "Clear Filter",
@@ -256,6 +274,17 @@
"noTagsFound": "No tags found",
"asc": "ASC",
"desc": "DESC",
+ "fileSize": "File Size",
+ "lastUpdated": "Last Updated",
+ "fileCreated": "File Created",
+ "lastModified": "Last Modified",
+ "authorFirstLast": "Author (First Last)",
+ "authorLastFirst": "Author (Last, First)",
+ "progressSort": "Progress",
+ "dateStarted": "Date Started",
+ "dateFinished": "Date Finished",
+ "episodeCount": "Episode Count",
+ "sequence": "Series Sequence",
"absorbingTitle": "Absorbing",
"absorbingStop": "Stop",
"absorbingManageQueue": "Manage Queue",
@@ -380,6 +409,7 @@
"statsTotalListeningTime": "TOTAL LISTENING TIME",
"statsHoursUnit": "h",
"statsMinutesUnit": "m",
+ "statsSecondsUnit": "s",
"statsDaysOfAudio": "That's {days} days of audio",
"@statsDaysOfAudio": {
"placeholders": {
@@ -2762,6 +2792,19 @@
"statsScreenListened": "Listened",
"sessionEditTitle": "Edit session",
"sessionDayLabel": "Day",
+ "sessionEndPosition": "Ending position",
+ "sessionEndPositionHint": "Changing this may also update your current progress.",
+ "statsViewSessions": "View sessions",
+ "statsSessionsForDate": "Sessions for {date}",
+ "@statsSessionsForDate": {
+ "placeholders": {
+ "date": {"type": "String"}
+ }
+ },
+ "statsNoSessionsForDate": "No listening sessions found for this day",
+ "statsSearchSessions": "Search sessions",
+ "statsNoSessionSearchResults": "No sessions match your search",
+ "statsSessionsLoadFailed": "Could not load sessions for this day",
"sessionDeleteConfirmTitle": "Delete session?",
"sessionDeleteConfirmBody": "This removes the session and lowers your listening totals by its time. It cannot be undone.",
"sessionSaved": "Session updated",
diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart
index 1b357d7d..2dcfe7e0 100644
--- a/lib/l10n/app_localizations.dart
+++ b/lib/l10n/app_localizations.dart
@@ -796,6 +796,12 @@ abstract class AppLocalizations {
/// **'No books found'**
String get libraryNoBooks;
+ /// No description provided for @libraryNoUnfinishedBooks.
+ ///
+ /// In en, this message translates to:
+ /// **'No unfinished books'**
+ String get libraryNoUnfinishedBooks;
+
/// No description provided for @libraryNoBooksInProgress.
///
/// In en, this message translates to:
@@ -832,6 +838,18 @@ abstract class AppLocalizations {
/// **'No books with eBooks'**
String get libraryNoBooksWithEbooks;
+ /// No description provided for @libraryNoBooksMissingMetadata.
+ ///
+ /// In en, this message translates to:
+ /// **'No books are missing this metadata'**
+ String get libraryNoBooksMissingMetadata;
+
+ /// No description provided for @libraryNoItemsMatchingFilter.
+ ///
+ /// In en, this message translates to:
+ /// **'No items match this filter'**
+ String get libraryNoItemsMatchingFilter;
+
/// No description provided for @libraryNoBooksInGenre.
///
/// In en, this message translates to:
@@ -1006,6 +1024,12 @@ abstract class AppLocalizations {
/// **'Collapse Series'**
String get collapseSeries;
+ /// No description provided for @notFinished.
+ ///
+ /// In en, this message translates to:
+ /// **'Not Finished'**
+ String get notFinished;
+
/// No description provided for @inProgress.
///
/// In en, this message translates to:
@@ -1036,6 +1060,90 @@ abstract class AppLocalizations {
/// **'Has eBook'**
String get hasEbook;
+ /// No description provided for @noEbook.
+ ///
+ /// In en, this message translates to:
+ /// **'No eBook'**
+ String get noEbook;
+
+ /// No description provided for @hasSupplementaryEbook.
+ ///
+ /// In en, this message translates to:
+ /// **'Has Supplementary eBook'**
+ String get hasSupplementaryEbook;
+
+ /// No description provided for @noSupplementaryEbook.
+ ///
+ /// In en, this message translates to:
+ /// **'No Supplementary eBook'**
+ String get noSupplementaryEbook;
+
+ /// No description provided for @noSeries.
+ ///
+ /// In en, this message translates to:
+ /// **'No Series'**
+ String get noSeries;
+
+ /// No description provided for @publishedDecade.
+ ///
+ /// In en, this message translates to:
+ /// **'Published Decade'**
+ String get publishedDecade;
+
+ /// No description provided for @tracks.
+ ///
+ /// In en, this message translates to:
+ /// **'Tracks'**
+ String get tracks;
+
+ /// No description provided for @noTracks.
+ ///
+ /// In en, this message translates to:
+ /// **'No Tracks'**
+ String get noTracks;
+
+ /// No description provided for @singleTrack.
+ ///
+ /// In en, this message translates to:
+ /// **'Single Track'**
+ String get singleTrack;
+
+ /// No description provided for @multipleTracks.
+ ///
+ /// In en, this message translates to:
+ /// **'Multiple Tracks'**
+ String get multipleTracks;
+
+ /// No description provided for @abridged.
+ ///
+ /// In en, this message translates to:
+ /// **'Abridged'**
+ String get abridged;
+
+ /// No description provided for @issues.
+ ///
+ /// In en, this message translates to:
+ /// **'Issues'**
+ String get issues;
+
+ /// No description provided for @rssFeedOpen.
+ ///
+ /// In en, this message translates to:
+ /// **'RSS Feed Open'**
+ String get rssFeedOpen;
+
+ /// No description provided for @explicitContent.
+ ///
+ /// In en, this message translates to:
+ /// **'Explicit'**
+ String get explicitContent;
+
+ /// No description provided for @missingMetadata.
+ ///
+ /// In en, this message translates to:
+ /// **'Missing Metadata'**
+ String get missingMetadata;
+
/// No description provided for @genre.
///
/// In en, this message translates to:
@@ -1078,6 +1186,72 @@ abstract class AppLocalizations {
/// **'DESC'**
String get desc;
+ /// No description provided for @fileSize.
+ ///
+ /// In en, this message translates to:
+ /// **'File Size'**
+ String get fileSize;
+
+ /// No description provided for @lastUpdated.
+ ///
+ /// In en, this message translates to:
+ /// **'Last Updated'**
+ String get lastUpdated;
+
+ /// No description provided for @fileCreated.
+ ///
+ /// In en, this message translates to:
+ /// **'File Created'**
+ String get fileCreated;
+
+ /// No description provided for @lastModified.
+ ///
+ /// In en, this message translates to:
+ /// **'Last Modified'**
+ String get lastModified;
+
+ /// No description provided for @authorFirstLast.
+ ///
+ /// In en, this message translates to:
+ /// **'Author (First Last)'**
+ String get authorFirstLast;
+
+ /// No description provided for @authorLastFirst.
+ ///
+ /// In en, this message translates to:
+ /// **'Author (Last, First)'**
+ String get authorLastFirst;
+
+ /// No description provided for @progressSort.
+ ///
+ /// In en, this message translates to:
+ /// **'Progress'**
+ String get progressSort;
+
+ /// No description provided for @dateStarted.
+ ///
+ /// In en, this message translates to:
+ /// **'Date Started'**
+ String get dateStarted;
+
+ /// No description provided for @dateFinished.
+ ///
+ /// In en, this message translates to:
+ /// **'Date Finished'**
+ String get dateFinished;
+
+ /// No description provided for @episodeCount.
+ ///
+ /// In en, this message translates to:
+ /// **'Episode Count'**
+ String get episodeCount;
+
+ /// No description provided for @sequence.
+ ///
+ /// In en, this message translates to:
+ /// **'Series Sequence'**
+ String get sequence;
+
/// No description provided for @absorbingTitle.
///
/// In en, this message translates to:
@@ -1408,6 +1582,12 @@ abstract class AppLocalizations {
/// **'m'**
String get statsMinutesUnit;
+ /// No description provided for @statsSecondsUnit.
+ ///
+ /// In en, this message translates to:
+ /// **'s'**
+ String get statsSecondsUnit;
+
/// No description provided for @statsDaysOfAudio.
///
/// In en, this message translates to:
@@ -8516,6 +8696,54 @@ abstract class AppLocalizations {
/// **'Day'**
String get sessionDayLabel;
+ /// No description provided for @sessionEndPosition.
+ ///
+ /// In en, this message translates to:
+ /// **'Ending position'**
+ String get sessionEndPosition;
+
+ /// No description provided for @sessionEndPositionHint.
+ ///
+ /// In en, this message translates to:
+ /// **'Changing this may also update your current progress.'**
+ String get sessionEndPositionHint;
+
+ /// No description provided for @statsViewSessions.
+ ///
+ /// In en, this message translates to:
+ /// **'View sessions'**
+ String get statsViewSessions;
+
+ /// No description provided for @statsSessionsForDate.
+ ///
+ /// In en, this message translates to:
+ /// **'Sessions for {date}'**
+ String statsSessionsForDate(String date);
+
+ /// No description provided for @statsNoSessionsForDate.
+ ///
+ /// In en, this message translates to:
+ /// **'No listening sessions found for this day'**
+ String get statsNoSessionsForDate;
+
+ /// No description provided for @statsSearchSessions.
+ ///
+ /// In en, this message translates to:
+ /// **'Search sessions'**
+ String get statsSearchSessions;
+
+ /// No description provided for @statsNoSessionSearchResults.
+ ///
+ /// In en, this message translates to:
+ /// **'No sessions match your search'**
+ String get statsNoSessionSearchResults;
+
+ /// No description provided for @statsSessionsLoadFailed.
+ ///
+ /// In en, this message translates to:
+ /// **'Could not load sessions for this day'**
+ String get statsSessionsLoadFailed;
+
/// No description provided for @sessionDeleteConfirmTitle.
///
/// In en, this message translates to:
diff --git a/lib/l10n/app_localizations_de.dart b/lib/l10n/app_localizations_de.dart
index 2db944d6..840681db 100644
--- a/lib/l10n/app_localizations_de.dart
+++ b/lib/l10n/app_localizations_de.dart
@@ -387,6 +387,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get libraryNoBooks => 'Keine Bücher gefunden';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'Keine angefangenen Bücher';
@@ -405,6 +408,13 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'Keine Bücher mit eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'Keine Bücher in \"$genre\"';
@@ -504,6 +514,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get collapseSeries => 'Serien zusammenklappen';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'Angefangen';
@@ -519,6 +532,48 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get hasEbook => 'Mit eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -540,6 +595,39 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get desc => 'AB';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -730,6 +818,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'Das sind $days Tage Audio';
@@ -4868,6 +4959,34 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_el.dart b/lib/l10n/app_localizations_el.dart
index 05065932..91a230a1 100644
--- a/lib/l10n/app_localizations_el.dart
+++ b/lib/l10n/app_localizations_el.dart
@@ -384,6 +384,9 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get libraryNoBooks => 'No books found';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'No books in progress';
@@ -402,6 +405,13 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'No books in \"$genre\"';
@@ -501,6 +511,9 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'In Progress';
@@ -516,6 +529,48 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -537,6 +592,39 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get desc => 'DESC';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -725,6 +813,9 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4818,6 +4909,34 @@ class AppLocalizationsEl extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart
index 59db1093..91945ba7 100644
--- a/lib/l10n/app_localizations_en.dart
+++ b/lib/l10n/app_localizations_en.dart
@@ -384,6 +384,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get libraryNoBooks => 'No books found';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'No books in progress';
@@ -402,6 +405,13 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'No books in \"$genre\"';
@@ -501,6 +511,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'In Progress';
@@ -516,6 +529,48 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -537,6 +592,39 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get desc => 'DESC';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -725,6 +813,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4818,6 +4909,34 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_es.dart b/lib/l10n/app_localizations_es.dart
index 1a22d99a..003e735a 100644
--- a/lib/l10n/app_localizations_es.dart
+++ b/lib/l10n/app_localizations_es.dart
@@ -384,6 +384,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get libraryNoBooks => 'No books found';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'No books in progress';
@@ -402,6 +405,13 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'No books in \"$genre\"';
@@ -501,6 +511,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'In Progress';
@@ -516,6 +529,48 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -537,6 +592,39 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get desc => 'DESC';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -725,6 +813,9 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4818,6 +4909,34 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_fr.dart b/lib/l10n/app_localizations_fr.dart
index 4597df01..297ce056 100644
--- a/lib/l10n/app_localizations_fr.dart
+++ b/lib/l10n/app_localizations_fr.dart
@@ -386,6 +386,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get libraryNoBooks => 'Aucun livre trouvé';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'Aucun livre en cours de lecture';
@@ -404,6 +407,13 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'Aucun livre du genre \"$genre\"';
@@ -503,6 +513,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'En cours';
@@ -518,6 +531,48 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -539,6 +594,39 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get desc => 'Décroissant';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Lecture';
@@ -727,6 +815,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4820,6 +4911,34 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_it.dart b/lib/l10n/app_localizations_it.dart
index 6b5c1950..c2adb572 100644
--- a/lib/l10n/app_localizations_it.dart
+++ b/lib/l10n/app_localizations_it.dart
@@ -384,6 +384,9 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get libraryNoBooks => 'No books found';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'No books in progress';
@@ -402,6 +405,13 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'No books in \"$genre\"';
@@ -501,6 +511,9 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'In Progress';
@@ -516,6 +529,48 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -537,6 +592,39 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get desc => 'DESC';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -725,6 +813,9 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4818,6 +4909,34 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_ja.dart b/lib/l10n/app_localizations_ja.dart
index f5acff78..fd4541c6 100644
--- a/lib/l10n/app_localizations_ja.dart
+++ b/lib/l10n/app_localizations_ja.dart
@@ -384,6 +384,9 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get libraryNoBooks => 'No books found';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'No books in progress';
@@ -402,6 +405,13 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'No books in \"$genre\"';
@@ -501,6 +511,9 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'In Progress';
@@ -516,6 +529,48 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -537,6 +592,39 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get desc => 'DESC';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -725,6 +813,9 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4818,6 +4909,34 @@ class AppLocalizationsJa extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_no.dart b/lib/l10n/app_localizations_no.dart
index ce5761ef..e37f9105 100644
--- a/lib/l10n/app_localizations_no.dart
+++ b/lib/l10n/app_localizations_no.dart
@@ -384,6 +384,9 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get libraryNoBooks => 'No books found';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'No books in progress';
@@ -402,6 +405,13 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'No books in \"$genre\"';
@@ -501,6 +511,9 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'In Progress';
@@ -516,6 +529,48 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -537,6 +592,39 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get desc => 'DESC';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -725,6 +813,9 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4818,6 +4909,34 @@ class AppLocalizationsNo extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart
index 0872c137..d6b48f26 100644
--- a/lib/l10n/app_localizations_pt.dart
+++ b/lib/l10n/app_localizations_pt.dart
@@ -384,6 +384,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get libraryNoBooks => 'No books found';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'No books in progress';
@@ -402,6 +405,13 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'No books in \"$genre\"';
@@ -501,6 +511,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'In Progress';
@@ -516,6 +529,48 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -537,6 +592,39 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get desc => 'DESC';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -725,6 +813,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4818,6 +4909,34 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_ro.dart b/lib/l10n/app_localizations_ro.dart
index af7a4f74..f5cfc5de 100644
--- a/lib/l10n/app_localizations_ro.dart
+++ b/lib/l10n/app_localizations_ro.dart
@@ -384,6 +384,9 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get libraryNoBooks => 'No books found';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'No books in progress';
@@ -402,6 +405,13 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'No books in \"$genre\"';
@@ -501,6 +511,9 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'In Progress';
@@ -516,6 +529,48 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -537,6 +592,39 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get desc => 'DESC';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -725,6 +813,9 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4818,6 +4909,34 @@ class AppLocalizationsRo extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_ru.dart b/lib/l10n/app_localizations_ru.dart
index 43e506bc..6be04ec3 100644
--- a/lib/l10n/app_localizations_ru.dart
+++ b/lib/l10n/app_localizations_ru.dart
@@ -385,6 +385,9 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get libraryNoBooks => 'No books found';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => 'No books in progress';
@@ -403,6 +406,13 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => 'No books with eBooks';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return 'No books in \"$genre\"';
@@ -502,6 +512,9 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get collapseSeries => 'Collapse Series';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => 'In Progress';
@@ -517,6 +530,48 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get hasEbook => 'Has eBook';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => 'Genre';
@@ -538,6 +593,39 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get desc => 'DESC';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => 'Absorbing';
@@ -726,6 +814,9 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get statsMinutesUnit => 'm';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return 'That\'s $days days of audio';
@@ -4821,6 +4912,34 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/l10n/app_localizations_zh.dart b/lib/l10n/app_localizations_zh.dart
index 683638ee..5174dc5f 100644
--- a/lib/l10n/app_localizations_zh.dart
+++ b/lib/l10n/app_localizations_zh.dart
@@ -378,6 +378,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get libraryNoBooks => '未找到书籍';
+ @override
+ String get libraryNoUnfinishedBooks => 'No unfinished books';
+
@override
String get libraryNoBooksInProgress => '暂无进行中的书籍';
@@ -396,6 +399,13 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get libraryNoBooksWithEbooks => '暂无包含电子书的书籍';
+ @override
+ String get libraryNoBooksMissingMetadata =>
+ 'No books are missing this metadata';
+
+ @override
+ String get libraryNoItemsMatchingFilter => 'No items match this filter';
+
@override
String libraryNoBooksInGenre(String genre) {
return '\"$genre\" 中没有找到书籍';
@@ -495,6 +505,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get collapseSeries => '折叠系列';
+ @override
+ String get notFinished => 'Not Finished';
+
@override
String get inProgress => '正在收听';
@@ -510,6 +523,48 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get hasEbook => '含电子书';
+ @override
+ String get noEbook => 'No eBook';
+
+ @override
+ String get hasSupplementaryEbook => 'Has Supplementary eBook';
+
+ @override
+ String get noSupplementaryEbook => 'No Supplementary eBook';
+
+ @override
+ String get noSeries => 'No Series';
+
+ @override
+ String get publishedDecade => 'Published Decade';
+
+ @override
+ String get tracks => 'Tracks';
+
+ @override
+ String get noTracks => 'No Tracks';
+
+ @override
+ String get singleTrack => 'Single Track';
+
+ @override
+ String get multipleTracks => 'Multiple Tracks';
+
+ @override
+ String get abridged => 'Abridged';
+
+ @override
+ String get issues => 'Issues';
+
+ @override
+ String get rssFeedOpen => 'RSS Feed Open';
+
+ @override
+ String get explicitContent => 'Explicit';
+
+ @override
+ String get missingMetadata => 'Missing Metadata';
+
@override
String get genre => '分类';
@@ -531,6 +586,39 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get desc => '降序';
+ @override
+ String get fileSize => 'File Size';
+
+ @override
+ String get lastUpdated => 'Last Updated';
+
+ @override
+ String get fileCreated => 'File Created';
+
+ @override
+ String get lastModified => 'Last Modified';
+
+ @override
+ String get authorFirstLast => 'Author (First Last)';
+
+ @override
+ String get authorLastFirst => 'Author (Last, First)';
+
+ @override
+ String get progressSort => 'Progress';
+
+ @override
+ String get dateStarted => 'Date Started';
+
+ @override
+ String get dateFinished => 'Date Finished';
+
+ @override
+ String get episodeCount => 'Episode Count';
+
+ @override
+ String get sequence => 'Series Sequence';
+
@override
String get absorbingTitle => '正在收听';
@@ -714,6 +802,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get statsMinutesUnit => '分钟';
+ @override
+ String get statsSecondsUnit => 's';
+
@override
String statsDaysOfAudio(String days) {
return '相当于 $days 天的音频';
@@ -4744,6 +4835,34 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get sessionDayLabel => 'Day';
+ @override
+ String get sessionEndPosition => 'Ending position';
+
+ @override
+ String get sessionEndPositionHint =>
+ 'Changing this may also update your current progress.';
+
+ @override
+ String get statsViewSessions => 'View sessions';
+
+ @override
+ String statsSessionsForDate(String date) {
+ return 'Sessions for $date';
+ }
+
+ @override
+ String get statsNoSessionsForDate =>
+ 'No listening sessions found for this day';
+
+ @override
+ String get statsSearchSessions => 'Search sessions';
+
+ @override
+ String get statsNoSessionSearchResults => 'No sessions match your search';
+
+ @override
+ String get statsSessionsLoadFailed => 'Could not load sessions for this day';
+
@override
String get sessionDeleteConfirmTitle => 'Delete session?';
diff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dart
index bd63a0e5..a9e3306b 100644
--- a/lib/providers/auth_provider.dart
+++ b/lib/providers/auth_provider.dart
@@ -87,6 +87,11 @@ class AuthProvider extends ChangeNotifier {
bool get isRoot => _userJson?['type'] == 'root';
+ bool get canAccessExplicitContent {
+ final perms = _userJson?['permissions'] as Map<String, dynamic>?;
+ return perms?['accessExplicitContent'] == true;
+ }
+
/// True when this user is allowed to edit library item metadata on the
/// server. Admins/root always can; regular users need the `update`
/// permission flag (set per-user in the ABS admin UI).
diff --git a/lib/screens/library_screen.dart b/lib/screens/library_screen.dart
index b0838b80..37da48b3 100644
--- a/lib/screens/library_screen.dart
+++ b/lib/screens/library_screen.dart
@@ -59,8 +59,18 @@ enum LibrarySort {
recentlyAdded,
alphabetical,
authorName,
+ authorFirstLast,
publishedYear,
duration,
+ fileSize,
+ lastUpdated,
+ fileCreated,
+ lastModified,
+ progress,
+ dateStarted,
+ dateFinished,
+ episodeCount,
+ sequence,
random,
totalDuration,
}
@@ -68,21 +78,196 @@ enum LibrarySort {
// ─── Filter modes ────────────────────────────────────────────
enum LibraryFilter {
none,
+ notFinished,
inProgress,
finished,
notStarted,
downloaded,
+ subscribed,
inASeries,
hasEbook,
+ noEbook,
+ hasSupplementaryEbook,
+ noSupplementaryEbook,
+ series,
+ author,
+ narrator,
+ language,
+ publisher,
+ publishedDecade,
+ noTracks,
+ singleTrack,
+ multipleTracks,
+ abridged,
+ issues,
+ feedOpen,
+ explicit,
+ missingMetadata,
genre,
tag,
}
+extension LibraryFilterProgressValue on LibraryFilter {
+ String? get progressValue => switch (this) {
+ LibraryFilter.notFinished => 'not-finished',
+ LibraryFilter.inProgress => 'in-progress',
+ LibraryFilter.finished => 'finished',
+ LibraryFilter.notStarted => 'not-started',
+ _ => null,
+ };
+}
+
+enum MissingMetadataField {
+ asin,
+ isbn,
+ subtitle,
+ authors,
+ publishedYear,
+ series,
+ description,
+ genres,
+ tags,
+ narrators,
+ publisher,
+ language,
+ cover,
+ chapters,
+}
+
+extension MissingMetadataFieldValue on MissingMetadataField {
+ String get filterValue => switch (this) {
+ MissingMetadataField.asin => 'asin',
+ MissingMetadataField.isbn => 'isbn',
+ MissingMetadataField.subtitle => 'subtitle',
+ MissingMetadataField.authors => 'authors',
+ MissingMetadataField.publishedYear => 'publishedYear',
+ MissingMetadataField.series => 'series',
+ MissingMetadataField.description => 'description',
+ MissingMetadataField.genres => 'genres',
+ MissingMetadataField.tags => 'tags',
+ MissingMetadataField.narrators => 'narrators',
+ MissingMetadataField.publisher => 'publisher',
+ MissingMetadataField.language => 'language',
+ MissingMetadataField.cover => 'cover',
+ MissingMetadataField.chapters => 'chapters',
+ };
+}
+
+String missingMetadataFieldLabel(
+ AppLocalizations l,
+ MissingMetadataField field,
+) => switch (field) {
+ MissingMetadataField.asin => l.asinLabel,
+ MissingMetadataField.isbn => l.isbnLabel,
+ MissingMetadataField.subtitle => l.subtitleLabel,
+ MissingMetadataField.authors => l.libraryTabAuthors,
+ MissingMetadataField.publishedYear => l.publishedYear,
+ MissingMetadataField.series => l.libraryTabSeries,
+ MissingMetadataField.description => l.descriptionLabel,
+ MissingMetadataField.genres => l.genresLabel,
+ MissingMetadataField.tags => l.tagsLabel,
+ MissingMetadataField.narrators => l.libraryTabNarrators,
+ MissingMetadataField.publisher => l.publisherLabel,
+ MissingMetadataField.language => l.languageLabel,
+ MissingMetadataField.cover => l.editTabCover,
+ MissingMetadataField.chapters => l.chapters,
+};
+
+String _encodedLibraryFilter(String group, String value) =>
+ '$group.${base64Encode(utf8.encode(value))}';
+
+String? buildLibraryFilterQuery(
+ LibraryFilter filter, {
+ String? genre,
+ String? tag,
+ String? filterValue,
+ MissingMetadataField? missingMetadata,
+}) {
+ final progressValue = filter.progressValue;
+ if (progressValue != null) {
+ return _encodedLibraryFilter('progress', progressValue);
+ }
+ return switch (filter) {
+ LibraryFilter.hasEbook => _encodedLibraryFilter('ebooks', 'ebook'),
+ LibraryFilter.noEbook => _encodedLibraryFilter('ebooks', 'no-ebook'),
+ LibraryFilter.hasSupplementaryEbook =>
+ _encodedLibraryFilter('ebooks', 'supplementary'),
+ LibraryFilter.noSupplementaryEbook =>
+ _encodedLibraryFilter('ebooks', 'no-supplementary'),
+ LibraryFilter.series when filterValue != null =>
+ _encodedLibraryFilter('series', filterValue),
+ LibraryFilter.author when filterValue != null =>
+ _encodedLibraryFilter('authors', filterValue),
+ LibraryFilter.narrator when filterValue != null =>
+ _encodedLibraryFilter('narrators', filterValue),
+ LibraryFilter.language when filterValue != null =>
+ _encodedLibraryFilter('languages', filterValue),
+ LibraryFilter.publisher when filterValue != null =>
+ _encodedLibraryFilter('publishers', filterValue),
+ LibraryFilter.publishedDecade when filterValue != null =>
+ _encodedLibraryFilter('publishedDecades', filterValue),
+ LibraryFilter.noTracks => _encodedLibraryFilter('tracks', 'none'),
+ LibraryFilter.singleTrack => _encodedLibraryFilter('tracks', 'single'),
+ LibraryFilter.multipleTracks => _encodedLibraryFilter('tracks', 'multi'),
+ LibraryFilter.abridged => 'abridged',
+ LibraryFilter.issues => 'issues',
+ LibraryFilter.feedOpen => 'feed-open',
+ LibraryFilter.explicit => 'explicit',
+ LibraryFilter.genre when genre != null =>
+ _encodedLibraryFilter('genres', genre),
+ LibraryFilter.tag when tag != null => _encodedLibraryFilter('tags', tag),
+ LibraryFilter.missingMetadata when missingMetadata != null =>
+ _encodedLibraryFilter('missing', missingMetadata.filterValue),
+ _ => null,
+ };
+}
+
+bool libraryFilterSupportsMediaType(
+ LibraryFilter filter, {
+ required bool isPodcast,
+}) {
+ if (!isPodcast) return filter != LibraryFilter.subscribed;
+ return switch (filter) {
+ LibraryFilter.none ||
+ LibraryFilter.subscribed ||
+ LibraryFilter.genre ||
+ LibraryFilter.tag ||
+ LibraryFilter.language ||
+ LibraryFilter.issues ||
+ LibraryFilter.feedOpen ||
+ LibraryFilter.explicit => true,
+ _ => false,
+ };
+}
+
+bool libraryFilterRequiresValue(LibraryFilter filter) => switch (filter) {
+ LibraryFilter.series ||
+ LibraryFilter.author ||
+ LibraryFilter.narrator ||
+ LibraryFilter.language ||
+ LibraryFilter.publisher ||
+ LibraryFilter.publishedDecade => true,
+ _ => false,
+};
+
/// Series-tab progress filter. Computed client-side from per-book progress
/// because the ABS server's `?filter=` param doesn't support series-level
/// progress queries (only book-level). When a filter is active the series
/// tab fetches all pages upfront so the client-side join is correct.
-enum SeriesFilter { none, inProgress, finished, notStarted }
+enum SeriesFilter { none, notFinished, inProgress, finished, notStarted }
+
+bool seriesProgressMatchesFilter(
+ SeriesFilter filter, {
+ required int bookCount,
+ required int startedCount,
+ required int finishedCount,
+}) => switch (filter) {
+ SeriesFilter.notFinished => finishedCount < bookCount,
+ SeriesFilter.finished => finishedCount == bookCount,
+ SeriesFilter.notStarted => startedCount == 0,
+ SeriesFilter.inProgress => startedCount > 0 && finishedCount < bookCount,
+ SeriesFilter.none => true,
+};
class LibraryScreen extends StatefulWidget {
const LibraryScreen({super.key});
@@ -160,6 +345,9 @@ class LibraryScreenState extends State<LibraryScreen>
LibraryFilter _filter = LibraryFilter.none;
String? _genreFilter;
String? _tagFilter;
+ String? _filterValue;
+ String? _filterValueLabel;
+ MissingMetadataField? _missingMetadataFilter;
/// Set to true the first time the user (or a chip tap via
/// AppShell.openLibraryWith*FilterGlobal) explicitly changes the filter.
@@ -170,6 +358,12 @@ class LibraryScreenState extends State<LibraryScreen>
bool _filterOverriddenByUser = false;
List<String> _availableGenres = [];
List<String> _availableTags = [];
+ List<Map<String, String>> _availableSeriesFilters = [];
+ List<Map<String, String>> _availableAuthorFilters = [];
+ List<String> _availableNarrators = [];
+ List<String> _availableLanguages = [];
+ List<String> _availablePublishers = [];
+ List<String> _availablePublishedDecades = [];
bool _hideEbookOnly = false;
final List<Map<String, dynamic>> _items = [];
@@ -385,6 +579,12 @@ class LibraryScreenState extends State<LibraryScreen>
_isLoadingPage = false;
_availableGenres = [];
_availableTags = [];
+ _availableSeriesFilters = [];
+ _availableAuthorFilters = [];
+ _availableNarrators = [];
+ _availableLanguages = [];
+ _availablePublishers = [];
+ _availablePublishedDecades = [];
// Clear series and author data
_seriesItems.clear();
_seriesPage = 0;
@@ -462,6 +662,14 @@ class LibraryScreenState extends State<LibraryScreen>
PlayerSettings.getLibrarySeriesFilter(),
PlayerSettings.getListsSort(),
PlayerSettings.getListsSortAsc(),
+ PlayerSettings.getLibraryMissingMetadataFilter(),
+ PlayerSettings.getLibraryFilterValue(),
+ PlayerSettings.getLibraryFilterValueLabel(),
+ PlayerSettings.getPodcastFilter(),
+ PlayerSettings.getPodcastGenreFilter(),
+ PlayerSettings.getPodcastTagFilter(),
+ PlayerSettings.getPodcastFilterValue(),
+ PlayerSettings.getPodcastFilterValueLabel(),
]);
if (!mounted) return;
final sortName = results[0] as String;
@@ -481,6 +689,14 @@ class LibraryScreenState extends State<LibraryScreen>
final seriesFilterName = results[14] as String;
final listsSortName = results[15] as String;
final listsSortAsc = results[16] as bool;
+ final missingMetadataFilterName = results[17] as String;
+ final libraryFilterValue = results[18] as String;
+ final libraryFilterValueLabel = results[19] as String;
+ final podcastFilterName = results[20] as String;
+ final podcastGenreFilter = results[21] as String;
+ final podcastTagFilter = results[22] as String;
+ final podcastFilterValue = results[23] as String;
+ final podcastFilterValueLabel = results[24] as String;
final lib = context.read<LibraryProvider>();
final isPodcast = lib.isPodcastLibrary;
// Read the remembered "has lists" flag so the Lists tab (and its pill) can
@@ -503,12 +719,60 @@ class LibraryScreenState extends State<LibraryScreen>
// session — that race would otherwise undo their selection on cold
// start when the library widget is mounting for the first time.
if (!_filterOverriddenByUser) {
+ final restoredFilterName = isPodcast ? podcastFilterName : filterName;
_filter = LibraryFilter.values.firstWhere(
- (f) => f.name == filterName,
+ (f) => f.name == restoredFilterName,
orElse: () => LibraryFilter.none,
);
- _genreFilter = genreFilter.isNotEmpty ? genreFilter : null;
- _tagFilter = tagFilter.isNotEmpty ? tagFilter : null;
+ if (!libraryFilterSupportsMediaType(
+ _filter,
+ isPodcast: isPodcast,
+ )) {
+ _filter = LibraryFilter.none;
+ }
+ final restoredGenre = isPodcast ? podcastGenreFilter : genreFilter;
+ final restoredTag = isPodcast ? podcastTagFilter : tagFilter;
+ final restoredValue = isPodcast
+ ? podcastFilterValue
+ : libraryFilterValue;
+ final restoredValueLabel = isPodcast
+ ? podcastFilterValueLabel
+ : libraryFilterValueLabel;
+ _genreFilter = _filter == LibraryFilter.genre && restoredGenre.isNotEmpty
+ ? restoredGenre
+ : null;
+ _tagFilter = _filter == LibraryFilter.tag && restoredTag.isNotEmpty
+ ? restoredTag
+ : null;
+ _filterValue = libraryFilterRequiresValue(_filter) &&
+ restoredValue.isNotEmpty
+ ? restoredValue
+ : null;
+ _filterValueLabel = _filterValue == null
+ ? null
+ : (restoredValueLabel.isNotEmpty
+ ? restoredValueLabel
+ : _filterValue);
+ _missingMetadataFilter = isPodcast
+ ? null
+ : MissingMetadataField.values
+ .where((field) => field.name == missingMetadataFilterName)
+ .firstOrNull;
+ if (_filter == LibraryFilter.missingMetadata &&
+ _missingMetadataFilter == null) {
+ _filter = LibraryFilter.none;
+ }
+ if (libraryFilterRequiresValue(_filter) && _filterValue == null) {
+ _filter = LibraryFilter.none;
+ }
+ if (!isPodcast &&
+ _sort == LibrarySort.sequence &&
+ !(_filter == LibraryFilter.series &&
+ _filterValue != null &&
+ _filterValue != 'no-series')) {
+ _sort = LibrarySort.alphabetical;
+ _sortAsc = true;
+ }
}
_seriesSort = LibrarySort.values.firstWhere(
(s) => s.name == seriesSortName,
@@ -544,9 +808,6 @@ class LibraryScreenState extends State<LibraryScreen>
if (isPodcast) {
_sort = _podcastSort;
_sortAsc = _podcastSortAsc;
- _filter = LibraryFilter.none;
- _genreFilter = null;
- _tagFilter = null;
}
// Seed the Lists pill from the remembered flag so it (and the restored
// Lists tab) show right away, before the lists load.
@@ -629,6 +890,13 @@ class LibraryScreenState extends State<LibraryScreen>
if (filterData != null && mounted) {
final genres = filterData['genres'] as List<dynamic>? ?? [];
final tags = filterData['tags'] as List<dynamic>? ?? [];
+ final series = filterData['series'] as List<dynamic>? ?? [];
+ final authors = filterData['authors'] as List<dynamic>? ?? [];
+ final narrators = filterData['narrators'] as List<dynamic>? ?? [];
+ final languages = filterData['languages'] as List<dynamic>? ?? [];
+ final publishers = filterData['publishers'] as List<dynamic>? ?? [];
+ final publishedDecades =
+ filterData['publishedDecades'] as List<dynamic>? ?? [];
String unwrap(dynamic v) =>
v is Map ? (v['name'] as String? ?? '') : v.toString();
setState(() {
@@ -637,6 +905,62 @@ class LibraryScreenState extends State<LibraryScreen>
..sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase()));
_availableTags = tags.map(unwrap).where((t) => t.isNotEmpty).toList()
..sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase()));
+ _availableSeriesFilters = series
+ .whereType<Map>()
+ .map(
+ (value) => {
+ 'id': value['id']?.toString() ?? '',
+ 'name': value['name']?.toString() ?? '',
+ },
+ )
+ .where(
+ (value) =>
+ value['id']!.isNotEmpty && value['name']!.isNotEmpty,
+ )
+ .toList()
+ ..sort(
+ (a, b) => a['name']!.toLowerCase().compareTo(
+ b['name']!.toLowerCase(),
+ ),
+ );
+ _availableAuthorFilters = authors
+ .whereType<Map>()
+ .map(
+ (value) => {
+ 'id': value['id']?.toString() ?? '',
+ 'name': value['name']?.toString() ?? '',
+ },
+ )
+ .where(
+ (value) =>
+ value['id']!.isNotEmpty && value['name']!.isNotEmpty,
+ )
+ .toList()
+ ..sort(
+ (a, b) => a['name']!.toLowerCase().compareTo(
+ b['name']!.toLowerCase(),
+ ),
+ );
+ _availableNarrators = narrators
+ .map(unwrap)
+ .where((value) => value.isNotEmpty)
+ .toList()
+ ..sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase()));
+ _availableLanguages = languages
+ .map(unwrap)
+ .where((value) => value.isNotEmpty)
+ .toList()
+ ..sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase()));
+ _availablePublishers = publishers
+ .map(unwrap)
+ .where((value) => value.isNotEmpty)
+ .toList()
+ ..sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase()));
+ _availablePublishedDecades = publishedDecades
+ .map(unwrap)
+ .where((value) => value.isNotEmpty)
+ .toList()
+ ..sort();
});
}
}
@@ -669,11 +993,6 @@ class LibraryScreenState extends State<LibraryScreen>
// widget, which calls back into _loadPage / _loadSeriesPage when the user
// approaches the bottom of the visible scroll view.
- // ABS filter format: <group>.<base64(value)>. Same encoding ApiService
- // uses for getBooksByAuthor.
- String _absFilter(String group, String value) =>
- '$group.${base64Encode(utf8.encode(value))}';
-
// ══════════════════════════════════════════════════════════════
// LIBRARY TAB - Load a page of items
// ══════════════════════════════════════════════════════════════
@@ -708,7 +1027,13 @@ class LibraryScreenState extends State<LibraryScreen>
desc = _sortAsc ? 0 : 1;
break;
case LibrarySort.authorName:
- sort = 'media.metadata.authorNameLF';
+ sort = lib.isPodcastLibrary
+ ? 'media.metadata.author'
+ : 'media.metadata.authorNameLF';
+ desc = _sortAsc ? 0 : 1;
+ break;
+ case LibrarySort.authorFirstLast:
+ sort = 'media.metadata.authorName';
desc = _sortAsc ? 0 : 1;
break;
case LibrarySort.publishedYear:
@@ -720,29 +1045,60 @@ class LibraryScreenState extends State<LibraryScreen>
sort = 'media.duration';
desc = _sortAsc ? 0 : 1;
break;
+ case LibrarySort.fileSize:
+ sort = 'size';
+ desc = _sortAsc ? 0 : 1;
+ break;
+ case LibrarySort.lastUpdated:
+ sort = 'updatedAt';
+ desc = _sortAsc ? 0 : 1;
+ break;
+ case LibrarySort.fileCreated:
+ sort = 'birthtimeMs';
+ desc = _sortAsc ? 0 : 1;
+ break;
+ case LibrarySort.lastModified:
+ sort = 'mtimeMs';
+ desc = _sortAsc ? 0 : 1;
+ break;
+ case LibrarySort.progress:
+ sort = 'progress';
+ desc = _sortAsc ? 0 : 1;
+ break;
+ case LibrarySort.dateStarted:
+ sort = 'progress.createdAt';
+ desc = _sortAsc ? 0 : 1;
+ break;
+ case LibrarySort.dateFinished:
+ sort = 'progress.finishedAt';
+ desc = _sortAsc ? 0 : 1;
+ break;
+ case LibrarySort.episodeCount:
+ sort = 'media.numTracks';
+ desc = _sortAsc ? 0 : 1;
+ break;
+ case LibrarySort.sequence:
+ sort = 'sequence';
+ desc = _sortAsc ? 0 : 1;
+ break;
case LibrarySort.random:
sort = 'addedAt';
desc = 1;
break;
}
- String? filter;
- if (_filter == LibraryFilter.inProgress) {
- filter = _absFilter('progress', 'in-progress');
- } else if (_filter == LibraryFilter.finished) {
- filter = _absFilter('progress', 'finished');
- } else if (_filter == LibraryFilter.notStarted) {
- filter = _absFilter('progress', 'not-started');
- } else if (_filter == LibraryFilter.hasEbook) {
- filter = _absFilter('ebooks', 'ebook');
- } else if (_filter == LibraryFilter.genre && _genreFilter != null) {
- filter = _absFilter('genres', _genreFilter!);
- } else if (_filter == LibraryFilter.tag && _tagFilter != null) {
- filter = _absFilter('tags', _tagFilter!);
- }
+ final filter = buildLibraryFilterQuery(
+ _filter,
+ genre: _genreFilter,
+ tag: _tagFilter,
+ filterValue: _filterValue,
+ missingMetadata: _missingMetadataFilter,
+ );
// Downloaded filter is client-side — handled after loading
- final useClientFilter = _filter == LibraryFilter.downloaded;
+ final filterDownloaded = _filter == LibraryFilter.downloaded;
+ final filterSubscribed = _filter == LibraryFilter.subscribed;
+ final useClientFilter = filterDownloaded || filterSubscribed;
final fetchAll = _sort == LibrarySort.random || useClientFilter;
if (fetchAll) {
@@ -778,7 +1134,9 @@ class LibraryScreenState extends State<LibraryScreen>
coverPath != null && coverPath.isNotEmpty,
);
}
- if (useClientFilter && !DownloadService().isDownloaded(id ?? ''))
+ if (filterDownloaded && !DownloadService().isDownloaded(id ?? ''))
+ continue;
+ if (filterSubscribed && !lib.isPodcastSubscribed(id ?? ''))
continue;
if (_hideEbookOnly && PlayerSettings.isEbookOnly(r)) continue;
_items.add(r);
@@ -789,7 +1147,7 @@ class LibraryScreenState extends State<LibraryScreen>
}
if (mounted && gen == _loadGeneration) {
setState(() {
- _totalItems = total;
+ _totalItems = useClientFilter ? _items.length : total;
if (_sort == LibrarySort.random) _items.shuffle(Random(_randomSeed));
_hasMore = false;
_isLoadingPage = false;
@@ -926,13 +1284,12 @@ class LibraryScreenState extends State<LibraryScreen>
}
}
- return switch (filter) {
- SeriesFilter.finished => finishedCount == books.length,
- SeriesFilter.notStarted => startedCount == 0,
- SeriesFilter.inProgress =>
- startedCount > 0 && finishedCount < books.length,
- SeriesFilter.none => true,
- };
+ return seriesProgressMatchesFilter(
+ filter,
+ bookCount: books.length,
+ startedCount: startedCount,
+ finishedCount: finishedCount,
+ );
}
Future<void> _loadSeriesPage() async {
@@ -1234,7 +1591,9 @@ class LibraryScreenState extends State<LibraryScreen>
_sortAsc =
newSort == LibrarySort.alphabetical ||
newSort == LibrarySort.authorName ||
- newSort == LibrarySort.duration;
+ newSort == LibrarySort.authorFirstLast ||
+ newSort == LibrarySort.duration ||
+ newSort == LibrarySort.sequence;
_items.clear();
_page = 0;
_hasMore = true;
@@ -1396,28 +1755,78 @@ class LibraryScreenState extends State<LibraryScreen>
}
// ── Change filter and reload ──
- void _changeFilter(LibraryFilter newFilter, {String? genre, String? tag}) {
+ void _changeFilter(
+ LibraryFilter newFilter, {
+ String? genre,
+ String? tag,
+ String? filterValue,
+ String? filterValueLabel,
+ MissingMetadataField? missingMetadata,
+ }) {
final sameAsCurrent =
- newFilter == _filter && genre == _genreFilter && tag == _tagFilter;
+ newFilter == _filter &&
+ genre == _genreFilter &&
+ tag == _tagFilter &&
+ filterValue == _filterValue &&
+ missingMetadata == _missingMetadataFilter;
final effective = sameAsCurrent ? LibraryFilter.none : newFilter;
- if (effective == _filter && genre == _genreFilter && tag == _tagFilter)
+ if (effective == _filter &&
+ genre == _genreFilter &&
+ tag == _tagFilter &&
+ filterValue == _filterValue &&
+ missingMetadata == _missingMetadataFilter) {
return;
+ }
final isPodcast = context.read<LibraryProvider>().isPodcastLibrary;
+ final resetSequenceSort =
+ !isPodcast &&
+ _sort == LibrarySort.sequence &&
+ !(effective == LibraryFilter.series &&
+ filterValue != null &&
+ filterValue != 'no-series');
_loadGeneration++;
setState(() {
_filter = effective;
_genreFilter = effective == LibraryFilter.genre ? genre : null;
_tagFilter = effective == LibraryFilter.tag ? tag : null;
+ _filterValue = libraryFilterRequiresValue(effective)
+ ? filterValue
+ : null;
+ _filterValueLabel = _filterValue == null
+ ? null
+ : (filterValueLabel ?? filterValue);
+ _missingMetadataFilter = effective == LibraryFilter.missingMetadata
+ ? missingMetadata
+ : null;
+ if (resetSequenceSort) {
+ _sort = LibrarySort.alphabetical;
+ _sortAsc = true;
+ }
_items.clear();
_page = 0;
_hasMore = true;
_isLoadingPage = false;
_filterOverriddenByUser = true;
});
- if (!isPodcast) {
+ if (isPodcast) {
+ PlayerSettings.setPodcastFilter(_filter.name);
+ PlayerSettings.setPodcastGenreFilter(_genreFilter);
+ PlayerSettings.setPodcastTagFilter(_tagFilter);
+ PlayerSettings.setPodcastFilterValue(_filterValue);
+ PlayerSettings.setPodcastFilterValueLabel(_filterValueLabel);
+ } else {
+ if (resetSequenceSort) {
+ PlayerSettings.setLibrarySort(_sort.name);
+ PlayerSettings.setLibrarySortAsc(_sortAsc);
+ }
PlayerSettings.setLibraryFilter(_filter.name);
PlayerSettings.setLibraryGenreFilter(_genreFilter);
PlayerSettings.setLibraryTagFilter(_tagFilter);
+ PlayerSettings.setLibraryFilterValue(_filterValue);
+ PlayerSettings.setLibraryFilterValueLabel(_filterValueLabel);
+ PlayerSettings.setLibraryMissingMetadataFilter(
+ _missingMetadataFilter?.name,
+ );
}
if (_scrollController.hasClients) _scrollController.jumpTo(0);
_loadPage();
@@ -1721,6 +2130,7 @@ class LibraryScreenState extends State<LibraryScreen>
}
String _seriesFilterLabelOf(AppLocalizations l) => switch (_seriesFilter) {
+ SeriesFilter.notFinished => l.notFinished,
SeriesFilter.inProgress => l.inProgress,
SeriesFilter.finished => l.filterFinished,
SeriesFilter.notStarted => l.notStarted,
@@ -1728,12 +2138,34 @@ class LibraryScreenState extends State<LibraryScreen>
};
String _filterLabelOf(AppLocalizations l) => switch (_filter) {
+ LibraryFilter.notFinished => l.notFinished,
LibraryFilter.inProgress => l.inProgress,
LibraryFilter.finished => l.filterFinished,
LibraryFilter.notStarted => l.notStarted,
LibraryFilter.downloaded => l.downloaded,
+ LibraryFilter.subscribed => l.episodeListSubscribedChip,
LibraryFilter.inASeries => l.libraryTabSeries,
LibraryFilter.hasEbook => l.hasEbook,
+ LibraryFilter.noEbook => l.noEbook,
+ LibraryFilter.hasSupplementaryEbook => l.hasSupplementaryEbook,
+ LibraryFilter.noSupplementaryEbook => l.noSupplementaryEbook,
+ LibraryFilter.series => _filterValueLabel ?? l.libraryTabSeries,
+ LibraryFilter.author => _filterValueLabel ?? l.author,
+ LibraryFilter.narrator => _filterValueLabel ?? l.libraryTabNarrators,
+ LibraryFilter.language => _filterValueLabel ?? l.languageLabel,
+ LibraryFilter.publisher => _filterValueLabel ?? l.publisherLabel,
+ LibraryFilter.publishedDecade =>
+ _filterValueLabel ?? l.publishedDecade,
+ LibraryFilter.noTracks => l.noTracks,
+ LibraryFilter.singleTrack => l.singleTrack,
+ LibraryFilter.multipleTracks => l.multipleTracks,
+ LibraryFilter.abridged => l.abridged,
+ LibraryFilter.issues => l.issues,
+ LibraryFilter.feedOpen => l.rssFeedOpen,
+ LibraryFilter.explicit => l.explicitContent,
+ LibraryFilter.missingMetadata => _missingMetadataFilter == null
+ ? l.missingMetadata
+ : missingMetadataFieldLabel(l, _missingMetadataFilter!),
LibraryFilter.genre => _genreFilter ?? l.genre,
LibraryFilter.tag => _tagFilter ?? l.tag,
LibraryFilter.none => '',
@@ -1786,8 +2218,16 @@ class LibraryScreenState extends State<LibraryScreen>
currentFilter: _filter,
genreFilter: _genreFilter,
tagFilter: _tagFilter,
+ filterValue: _filterValue,
+ missingMetadataFilter: _missingMetadataFilter,
availableGenres: _availableGenres,
availableTags: _availableTags,
+ availableSeries: _availableSeriesFilters,
+ availableAuthors: _availableAuthorFilters,
+ availableNarrators: _availableNarrators,
+ availableLanguages: _availableLanguages,
+ availablePublishers: _availablePublishers,
+ availablePublishedDecades: _availablePublishedDecades,
initialTab: initialTab,
cs: cs,
tt: tt,
@@ -1850,9 +2290,23 @@ class LibraryScreenState extends State<LibraryScreen>
}
Navigator.pop(ctx);
},
- onFilterChanged: (filter, {String? genre, String? tag}) {
+ onFilterChanged: (
+ filter, {
+ String? genre,
+ String? tag,
+ String? filterValue,
+ String? filterValueLabel,
+ MissingMetadataField? missingMetadata,
+ }) {
Navigator.pop(ctx);
- _changeFilter(filter, genre: genre, tag: tag);
+ _changeFilter(
+ filter,
+ genre: genre,
+ tag: tag,
+ filterValue: filterValue,
+ filterValueLabel: filterValueLabel,
+ missingMetadata: missingMetadata,
+ );
},
onClearFilter: () {
Navigator.pop(ctx);
@@ -1873,6 +2327,8 @@ class LibraryScreenState extends State<LibraryScreen>
_loadPage();
},
isPodcastLibrary: context.read<LibraryProvider>().isPodcastLibrary,
+ canAccessExplicitContent:
+ context.read<AuthProvider>().canAccessExplicitContent,
onUpcomingReleases: tab == LibraryTab.series
? () {
Navigator.pop(ctx);
@@ -2510,7 +2966,12 @@ class LibraryScreenState extends State<LibraryScreen>
: (pCount > 0 ? '$pCount playlists' : '$cCount collections');
break;
default:
- countText = l.libraryBooksCount(_items.length, _totalItems);
+ final lib = context.read<LibraryProvider>();
+ final visibleCount = _visibleLibraryItems(lib).length;
+ countText = l.libraryBooksCount(
+ visibleCount,
+ _filter == LibraryFilter.subscribed ? visibleCount : _totalItems,
+ );
break;
}
@@ -2690,13 +3151,15 @@ class LibraryScreenState extends State<LibraryScreen>
// LIBRARY TAB - BROWSE GRID
// ═══════════════════════════════════════════════════════════════
Widget _buildGrid(Widget headerSliver) {
+ final lib = context.watch<LibraryProvider>();
return LibraryBooksTab(
- items: _items,
+ items: _visibleLibraryItems(lib),
isLoadingPage: _isLoadingPage,
hasMore: _hasMore,
filter: _filter,
genreFilter: _genreFilter,
tagFilter: _tagFilter,
+ isPodcastLibrary: context.read<LibraryProvider>().isPodcastLibrary,
rectangleCovers: _rectangleCovers,
coverAspectRatio: _coverAspectRatio,
onRefresh: _refreshAll,
@@ -2707,6 +3170,14 @@ class LibraryScreenState extends State<LibraryScreen>
);
}
+ List<Map<String, dynamic>> _visibleLibraryItems(LibraryProvider lib) {
+ if (_filter != LibraryFilter.subscribed) return _items;
+ return _items.where((item) {
+ final id = item['id'] as String?;
+ return id != null && lib.isPodcastSubscribed(id);
+ }).toList();
+ }
+
// ═══════════════════════════════════════════════════════════════
// SERIES TAB - GRID
// ═══════════════════════════════════════════════════════════════
diff --git a/lib/screens/login_screen.dart b/lib/screens/login_screen.dart
index e03f7cca..ce82409d 100644
--- a/lib/screens/login_screen.dart
+++ b/lib/screens/login_screen.dart
@@ -709,16 +709,6 @@ class _LoginScreenState extends State<LoginScreen>
),
],
- // SSO / OIDC button — only shown when server supports it
- AnimatedSize(
- duration: const Duration(milliseconds: 350),
- curve: Curves.easeOutCubic,
- alignment: Alignment.topCenter,
- child: _serverValid && _oidcConfig != null && _oidcConfig!.enabled
- ? _buildOidcButton(cs, tt)
- : const SizedBox.shrink(),
- ),
-
// Credentials — always visible
_buildCredentialFields(cs, tt),
],
@@ -1123,10 +1113,10 @@ class _LoginScreenState extends State<LoginScreen>
final l = AppLocalizations.of(context)!;
return Column(
children: [
- const SizedBox(height: 16),
+ const SizedBox(height: 12),
SizedBox(
width: double.infinity,
- height: 52,
+ height: 44,
child: OutlinedButton.icon(
onPressed: _isConnecting || _isOidcLoading ? null : _handleOidcLogin,
icon: _isOidcLoading
@@ -1145,12 +1135,12 @@ class _LoginScreenState extends State<LoginScreen>
style: OutlinedButton.styleFrom(
side: BorderSide(color: cs.primary.withValues(alpha: 0.3)),
shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(14),
+ borderRadius: BorderRadius.circular(12),
),
),
),
),
- const SizedBox(height: 8),
+ const SizedBox(height: 6),
Text(
l.loginRedirectUri,
style: tt.labelSmall?.copyWith(
@@ -1158,17 +1148,6 @@ class _LoginScreenState extends State<LoginScreen>
letterSpacing: 0.3,
),
),
- const SizedBox(height: 16),
- Row(
- children: [
- Expanded(child: Divider(color: cs.outlineVariant.withValues(alpha: 0.2))),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 14),
- child: Text(l.loginOrSignInManually, style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.5))),
- ),
- Expanded(child: Divider(color: cs.outlineVariant.withValues(alpha: 0.2))),
- ],
- ),
],
);
}
@@ -1293,6 +1272,14 @@ class _LoginScreenState extends State<LoginScreen>
),
),
),
+ AnimatedSize(
+ duration: const Duration(milliseconds: 350),
+ curve: Curves.easeOutCubic,
+ alignment: Alignment.topCenter,
+ child: _serverValid && _oidcConfig != null && _oidcConfig!.enabled
+ ? _buildOidcButton(cs, tt)
+ : const SizedBox.shrink(),
+ ),
],
diff --git a/lib/screens/stats_screen.dart b/lib/screens/stats_screen.dart
index 7809cfc4..d33c897c 100644
--- a/lib/screens/stats_screen.dart
+++ b/lib/screens/stats_screen.dart
@@ -10,6 +10,7 @@ import '../services/audio_player_service.dart';
import '../widgets/absorb_page_header.dart';
import '../widgets/finished_books_this_year_sheet.dart';
import '../widgets/stats_charts.dart';
+import '../widgets/day_sessions_sheet.dart';
import '../widgets/listening_session_card.dart';
import '../widgets/overlay_toast.dart';
import '../main.dart' show flatNotifier, gradientIntensityNotifier;
@@ -211,29 +212,57 @@ class _StatsScreenState extends State<StatsScreen>
border: Border.all(color: cs.primary.withValues(alpha: 0.18)),
),
child: Row(children: [
- Container(
- padding: const EdgeInsets.all(8),
- decoration: BoxDecoration(
- color: cs.primary.withValues(alpha: 0.15),
- borderRadius: BorderRadius.circular(10),
- ),
- child: Icon(Icons.calendar_today_rounded, size: 16, color: cs.primary),
- ),
- const SizedBox(width: 12),
Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(dateLabel,
- style: tt.bodyMedium?.copyWith(
- color: cs.onSurface, fontWeight: FontWeight.w600)),
- const SizedBox(height: 2),
- Text(_formatDuration(_selectedDaySeconds),
- style: tt.bodySmall?.copyWith(
- color: cs.primary, fontWeight: FontWeight.w600)),
- ],
+ child: InkWell(
+ onTap: () => _showDaySessions(date),
+ borderRadius: BorderRadius.circular(10),
+ child: Row(
+ children: [
+ Container(
+ padding: const EdgeInsets.all(8),
+ decoration: BoxDecoration(
+ color: cs.primary.withValues(alpha: 0.15),
+ borderRadius: BorderRadius.circular(10),
+ ),
+ child: Icon(
+ Icons.calendar_today_rounded,
+ size: 16,
+ color: cs.primary,
+ ),
+ ),
+ const SizedBox(width: 12),
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(dateLabel,
+ style: tt.bodyMedium?.copyWith(
+ color: cs.onSurface,
+ fontWeight: FontWeight.w600)),
+ const SizedBox(height: 2),
+ Text(_formatDuration(_selectedDaySeconds),
+ style: tt.bodySmall?.copyWith(
+ color: cs.primary,
+ fontWeight: FontWeight.w600)),
+ const SizedBox(height: 2),
+ Text(
+ l.statsViewSessions,
+ style: tt.labelSmall?.copyWith(
+ color: cs.onSurfaceVariant,
+ ),
+ ),
+ ],
+ ),
+ ),
+ Icon(
+ Icons.chevron_right_rounded,
+ color: cs.onSurfaceVariant.withValues(alpha: 0.55),
+ ),
+ ],
+ ),
),
),
+ const SizedBox(width: 6),
InkWell(
onTap: () => setState(() {
_selectedSection = null;
@@ -1465,12 +1494,69 @@ class _StatsScreenState extends State<StatsScreen>
}).toList();
}
- Future<void> _showSessionDetails(Map<String, dynamic> s) async {
+ Future<List<Map<String, dynamic>>> _loadSessionsForDay(DateTime day) async {
+ final api = context.read<AuthProvider>().apiService;
+ if (api == null) return const [];
+
+ const pageSize = 100;
+ final target = DateTime(day.year, day.month, day.day);
+ final sessions = <Map<String, dynamic>>[];
+ var page = 0;
+
+ while (page < 200) {
+ final data = await api.getListeningSessions(
+ page: page,
+ itemsPerPage: pageSize,
+ );
+ if (data == null) throw StateError('Could not load listening sessions');
+ final batch = (data['sessions'] as List<dynamic>? ?? const [])
+ .whereType<Map<String, dynamic>>()
+ .toList();
+ if (batch.isEmpty) break;
+
+ sessions.addAll(
+ batch.where((session) => listeningSessionMatchesDate(session, target)),
+ );
+
+ final oldestDay = listeningSessionDateOf(batch.last);
+ if (oldestDay != null) {
+ final oldest = DateTime(
+ oldestDay.year,
+ oldestDay.month,
+ oldestDay.day,
+ );
+ if (oldest.isBefore(target)) break;
+ }
+
+ final total = (data['total'] as num?)?.toInt();
+ if (batch.length < pageSize ||
+ (total != null && (page + 1) * pageSize >= total)) {
+ break;
+ }
+ page++;
+ }
+
+ sessions.sort((a, b) {
+ final aTime = (a['updatedAt'] as num?)?.toInt() ?? 0;
+ final bTime = (b['updatedAt'] as num?)?.toInt() ?? 0;
+ return bTime.compareTo(aTime);
+ });
+ return sessions;
+ }
+
+ Future<void> _showDaySessions(DateTime day) async {
final changed = await showModalBottomSheet<bool>(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
- builder: (_) => SessionDetailsSheet(session: s),
+ builder: (_) => DaySessionsSheet(
+ initialDate: day,
+ loadSessions: _loadSessionsForDay,
+ onSessionTap: (session) => _showSessionDetails(
+ session,
+ refreshStats: false,
+ ),
+ ),
);
if (changed == true && mounted) {
setState(() => _isLoading = true);
@@ -1478,6 +1564,23 @@ class _StatsScreenState extends State<StatsScreen>
}
}
+ Future<bool> _showSessionDetails(
+ Map<String, dynamic> s, {
+ bool refreshStats = true,
+ }) async {
+ final changed = await showModalBottomSheet<bool>(
+ context: context,
+ isScrollControlled: true,
+ backgroundColor: Colors.transparent,
+ builder: (_) => SessionDetailsSheet(session: s),
+ );
+ if (changed == true && mounted && refreshStats) {
+ setState(() => _isLoading = true);
+ await _loadStats();
+ }
+ return changed == true;
+ }
+
// --- HELPERS ---
static double _safeNum(dynamic val) => val is num ? val.toDouble() : 0;
@@ -1680,13 +1783,12 @@ class SessionDetailsSheetState extends State<SessionDetailsSheet> {
static String _two(int v) => v.toString().padLeft(2, '0');
- /// Edit how much listening this session counts for and which day it lands on.
- /// The server only honors timeListening and the day (re-derived from
- /// updatedAt) on an existing session, so those are all we expose.
+ /// Edit the fields the server supports for an existing session.
Future<void> _editSession() async {
final l = AppLocalizations.of(context)!;
final s = widget.session;
final origListening = _n(s['timeListening']).round();
+ final origCurrent = _n(s['currentTime']).round();
final origUpdatedMs = s['updatedAt'] is num
? (s['updatedAt'] as num).toInt()
: DateTime.now().millisecondsSinceEpoch;
@@ -1696,6 +1798,11 @@ class SessionDetailsSheetState extends State<SessionDetailsSheet> {
TextEditingController(text: '${origListening ~/ 3600}');
final minutesCtrl =
TextEditingController(text: '${(origListening % 3600) ~/ 60}');
+ final endHoursCtrl = TextEditingController(text: '${origCurrent ~/ 3600}');
+ final endMinutesCtrl = TextEditingController(
+ text: '${(origCurrent % 3600) ~/ 60}',
+ );
+ final endSecondsCtrl = TextEditingController(text: '${origCurrent % 60}');
var day = DateTime(origUpdated.year, origUpdated.month, origUpdated.day);
final saved = await showDialog<bool>(
@@ -1703,8 +1810,17 @@ class SessionDetailsSheetState extends State<SessionDetailsSheet> {
builder: (dialogCtx) {
return StatefulBuilder(builder: (dialogCtx, setDialog) {
return AlertDialog(
+ scrollable: true,
title: Text(l.sessionEditTitle),
content: Column(mainAxisSize: MainAxisSize.min, children: [
+ Align(
+ alignment: Alignment.centerLeft,
+ child: Text(
+ l.statsScreenListened,
+ style: Theme.of(dialogCtx).textTheme.labelLarge,
+ ),
+ ),
+ const SizedBox(height: 8),
Row(children: [
Expanded(
child: TextField(
@@ -1724,6 +1840,56 @@ class SessionDetailsSheetState extends State<SessionDetailsSheet> {
border: const OutlineInputBorder()),
)),
]),
+ const SizedBox(height: 16),
+ Align(
+ alignment: Alignment.centerLeft,
+ child: Text(
+ l.sessionEndPosition,
+ style: Theme.of(dialogCtx).textTheme.labelLarge,
+ ),
+ ),
+ const SizedBox(height: 8),
+ Row(children: [
+ Expanded(
+ child: TextField(
+ controller: endHoursCtrl,
+ keyboardType: TextInputType.number,
+ decoration: InputDecoration(
+ labelText: l.statsHoursUnit,
+ border: const OutlineInputBorder(),
+ ),
+ ),
+ ),
+ const SizedBox(width: 8),
+ Expanded(
+ child: TextField(
+ controller: endMinutesCtrl,
+ keyboardType: TextInputType.number,
+ decoration: InputDecoration(
+ labelText: l.statsMinutesUnit,
+ border: const OutlineInputBorder(),
+ ),
+ ),
+ ),
+ const SizedBox(width: 8),
+ Expanded(
+ child: TextField(
+ controller: endSecondsCtrl,
+ keyboardType: TextInputType.number,
+ decoration: InputDecoration(
+ labelText: l.statsSecondsUnit,
+ border: const OutlineInputBorder(),
+ ),
+ ),
+ ),
+ ]),
+ const SizedBox(height: 6),
+ Text(
+ l.sessionEndPositionHint,
+ style: Theme.of(dialogCtx).textTheme.bodySmall?.copyWith(
+ color: Theme.of(dialogCtx).colorScheme.onSurfaceVariant,
+ ),
+ ),
const SizedBox(height: 12),
Row(children: [
Text(l.sessionDayLabel,
@@ -1759,11 +1925,34 @@ class SessionDetailsSheetState extends State<SessionDetailsSheet> {
});
},
);
- if (saved != true || !mounted) return;
+ if (saved != true || !mounted) {
+ hoursCtrl.dispose();
+ minutesCtrl.dispose();
+ endHoursCtrl.dispose();
+ endMinutesCtrl.dispose();
+ endSecondsCtrl.dispose();
+ return;
+ }
final h = int.tryParse(hoursCtrl.text.trim()) ?? 0;
final m = int.tryParse(minutesCtrl.text.trim()) ?? 0;
final newListening = (h < 0 ? 0 : h) * 3600 + (m < 0 ? 0 : m) * 60;
+ final endH = int.tryParse(endHoursCtrl.text.trim()) ?? 0;
+ final endM = int.tryParse(endMinutesCtrl.text.trim()) ?? 0;
+ final endS = int.tryParse(endSecondsCtrl.text.trim()) ?? 0;
+ var newCurrent =
+ (endH < 0 ? 0 : endH) * 3600 +
+ (endM < 0 ? 0 : endM) * 60 +
+ (endS < 0 ? 0 : endS);
+ final duration = _n(s['duration']);
+ if (duration > 0 && newCurrent > duration) {
+ newCurrent = duration.round();
+ }
+ hoursCtrl.dispose();
+ minutesCtrl.dispose();
+ endHoursCtrl.dispose();
+ endMinutesCtrl.dispose();
+ endSecondsCtrl.dispose();
// Keep the original time-of-day so only the date moves.
final newUpdated = DateTime(day.year, day.month, day.day, origUpdated.hour,
origUpdated.minute, origUpdated.second)
@@ -1778,6 +1967,7 @@ class SessionDetailsSheetState extends State<SessionDetailsSheet> {
setState(() => _saving = true);
final edited = Map<String, dynamic>.from(s)
..['timeListening'] = newListening
+ ..['currentTime'] = newCurrent
..['updatedAt'] = newUpdated;
final ok = await api.updateListeningSession(edited);
if (!mounted) return;
diff --git a/lib/services/player_settings.dart b/lib/services/player_settings.dart
index 5815f71e..5e07817d 100644
--- a/lib/services/player_settings.dart
+++ b/lib/services/player_settings.dart
@@ -555,6 +555,20 @@ class PlayerSettings {
static Future<String> getLibraryTagFilter() => _get('libraryTagFilter', '');
static Future<void> setLibraryTagFilter(String? value) => _set('libraryTagFilter', value ?? '');
+ static Future<String> getLibraryMissingMetadataFilter() =>
+ _get('libraryMissingMetadataFilter', '');
+ static Future<void> setLibraryMissingMetadataFilter(String? value) =>
+ _set('libraryMissingMetadataFilter', value ?? '');
+
+ static Future<String> getLibraryFilterValue() =>
+ _get('libraryFilterValue', '');
+ static Future<void> setLibraryFilterValue(String? value) =>
+ _set('libraryFilterValue', value ?? '');
+ static Future<String> getLibraryFilterValueLabel() =>
+ _get('libraryFilterValueLabel', '');
+ static Future<void> setLibraryFilterValueLabel(String? value) =>
+ _set('libraryFilterValueLabel', value ?? '');
+
static Future<String> getLibrarySeriesFilter() => _get('librarySeriesFilter', 'none');
static Future<void> setLibrarySeriesFilter(String value) => _set('librarySeriesFilter', value);
@@ -569,6 +583,26 @@ class PlayerSettings {
static Future<bool> getPodcastSortAsc() => _get('podcastSortAsc', false);
static Future<void> setPodcastSortAsc(bool value) => _set('podcastSortAsc', value);
+ static Future<String> getPodcastFilter() => _get('podcastFilter', 'none');
+ static Future<void> setPodcastFilter(String value) =>
+ _set('podcastFilter', value);
+ static Future<String> getPodcastGenreFilter() =>
+ _get('podcastGenreFilter', '');
+ static Future<void> setPodcastGenreFilter(String? value) =>
+ _set('podcastGenreFilter', value ?? '');
+ static Future<String> getPodcastTagFilter() =>
+ _get('podcastTagFilter', '');
+ static Future<void> setPodcastTagFilter(String? value) =>
+ _set('podcastTagFilter', value ?? '');
+ static Future<String> getPodcastFilterValue() =>
+ _get('podcastFilterValue', '');
+ static Future<void> setPodcastFilterValue(String? value) =>
+ _set('podcastFilterValue', value ?? '');
+ static Future<String> getPodcastFilterValueLabel() =>
+ _get('podcastFilterValueLabel', '');
+ static Future<void> setPodcastFilterValueLabel(String? value) =>
+ _set('podcastFilterValueLabel', value ?? '');
+
static Future<String> getSeriesSort() => _get('seriesSort', 'alphabetical');
static Future<void> setSeriesSort(String value) => _set('seriesSort', value);
diff --git a/lib/widgets/day_sessions_sheet.dart b/lib/widgets/day_sessions_sheet.dart
new file mode 100644
index 00000000..af0cdc8d
--- /dev/null
+++ b/lib/widgets/day_sessions_sheet.dart
@@ -0,0 +1,314 @@
+import 'package:flutter/material.dart';
+
+import '../l10n/app_localizations.dart';
+import 'listening_session_card.dart';
+
+typedef DaySessionLoader =
+ Future<List<Map<String, dynamic>>> Function(DateTime day);
+typedef DaySessionOpener = Future<bool> Function(Map<String, dynamic> session);
+
+bool listeningSessionMatchesDate(Map<String, dynamic> session, DateTime day) {
+ final dateTime = listeningSessionDateOf(session);
+ if (dateTime == null) return false;
+ return dateTime.year == day.year &&
+ dateTime.month == day.month &&
+ dateTime.day == day.day;
+}
+
+DateTime? listeningSessionDateOf(Map<String, dynamic> session) {
+ final date = session['date'];
+ if (date is String && date.length >= 10) {
+ return DateTime.tryParse(date.substring(0, 10));
+ }
+
+ final updatedAt = session['updatedAt'];
+ if (updatedAt is! num) return null;
+ return DateTime.fromMillisecondsSinceEpoch(updatedAt.toInt());
+}
+
+bool listeningSessionMatchesSearch(Map<String, dynamic> session, String query) {
+ final normalized = query.trim().toLowerCase();
+ if (normalized.isEmpty) return true;
+
+ final metadata =
+ session['mediaMetadata'] as Map<String, dynamic>? ?? const {};
+ final device = session['deviceInfo'] as Map<String, dynamic>? ?? const {};
+ final searchable = [
+ session['displayTitle'],
+ session['displayAuthor'],
+ metadata['title'],
+ metadata['subtitle'],
+ metadata['authorName'],
+ metadata['narratorName'],
+ metadata['seriesName'],
+ device['clientName'],
+ device['deviceName'],
+ device['model'],
+ device['manufacturer'],
+ device['osName'],
+ ].whereType<String>().join(' ').toLowerCase();
+ return searchable.contains(normalized);
+}
+
+class DaySessionsSheet extends StatefulWidget {
+ const DaySessionsSheet({
+ super.key,
+ required this.initialDate,
+ required this.loadSessions,
+ required this.onSessionTap,
+ });
+
+ final DateTime initialDate;
+ final DaySessionLoader loadSessions;
+ final DaySessionOpener onSessionTap;
+
+ @override
+ State<DaySessionsSheet> createState() => _DaySessionsSheetState();
+}
+
+class _DaySessionsSheetState extends State<DaySessionsSheet> {
+ late DateTime _date;
+ final _searchController = TextEditingController();
+ List<Map<String, dynamic>> _sessions = const [];
+ bool _loading = true;
+ bool _loadFailed = false;
+ bool _changed = false;
+
+ @override
+ void initState() {
+ super.initState();
+ _date = DateTime(
+ widget.initialDate.year,
+ widget.initialDate.month,
+ widget.initialDate.day,
+ );
+ _load();
+ }
+
+ @override
+ void dispose() {
+ _searchController.dispose();
+ super.dispose();
+ }
+
+ Future<void> _load() async {
+ setState(() {
+ _loading = true;
+ _loadFailed = false;
+ });
+ try {
+ final sessions = await widget.loadSessions(_date);
+ if (!mounted) return;
+ setState(() {
+ _sessions = sessions;
+ _loading = false;
+ });
+ } catch (_) {
+ if (!mounted) return;
+ setState(() {
+ _sessions = const [];
+ _loading = false;
+ _loadFailed = true;
+ });
+ }
+ }
+
+ Future<void> _pickDate() async {
+ final now = DateTime.now();
+ final picked = await showDatePicker(
+ context: context,
+ initialDate: _date.isAfter(now) ? now : _date,
+ firstDate: DateTime(2000),
+ lastDate: now,
+ );
+ if (picked == null || !mounted) return;
+ setState(() {
+ _date = DateTime(picked.year, picked.month, picked.day);
+ _searchController.clear();
+ });
+ await _load();
+ }
+
+ Future<void> _openSession(Map<String, dynamic> session) async {
+ final changed = await widget.onSessionTap(session);
+ if (!mounted || !changed) return;
+ _changed = true;
+ await _load();
+ }
+
+ String _formatDuration(double seconds, AppLocalizations l) {
+ final hours = (seconds / 3600).floor();
+ final minutes = ((seconds % 3600) / 60).floor();
+ if (hours > 0) return l.statsScreenDurationHm(hours, minutes);
+ if (minutes > 0) return l.statsScreenDurationM(minutes);
+ if (seconds > 0) return l.statsScreenDurationLessThanMin;
+ return l.statsScreenDurationZero;
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final cs = Theme.of(context).colorScheme;
+ final tt = Theme.of(context).textTheme;
+ final l = AppLocalizations.of(context)!;
+ final dateLabel = MaterialLocalizations.of(context).formatFullDate(_date);
+ final filtered = _sessions
+ .where(
+ (session) =>
+ listeningSessionMatchesSearch(session, _searchController.text),
+ )
+ .toList();
+ final totalSeconds = filtered.fold<double>(
+ 0,
+ (total, session) =>
+ total + ((session['timeListening'] as num?)?.toDouble() ?? 0),
+ );
+ final countLabel = filtered.length == 1
+ ? l.statsScreenSessionCountOne(filtered.length)
+ : l.statsScreenSessionCountOther(filtered.length);
+
+ return DraggableScrollableSheet(
+ initialChildSize: 0.82,
+ minChildSize: 0.5,
+ maxChildSize: 0.96,
+ expand: false,
+ builder: (_, scrollController) {
+ return Container(
+ decoration: BoxDecoration(
+ color: cs.surface,
+ borderRadius: const BorderRadius.vertical(top: Radius.circular(24)),
+ ),
+ child: Column(
+ children: [
+ Padding(
+ padding: const EdgeInsets.fromLTRB(16, 10, 8, 8),
+ child: Row(
+ children: [
+ Expanded(
+ child: Text(
+ l.statsSessionsForDate(dateLabel),
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ style: tt.titleLarge?.copyWith(
+ fontWeight: FontWeight.w700,
+ ),
+ ),
+ ),
+ IconButton(
+ key: const Key('day-sessions-date-picker'),
+ tooltip: l.sessionDayLabel,
+ onPressed: _pickDate,
+ icon: const Icon(Icons.calendar_month_rounded),
+ ),
+ IconButton(
+ onPressed: () => Navigator.pop(context, _changed),
+ icon: const Icon(Icons.close_rounded),
+ ),
+ ],
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.fromLTRB(16, 0, 16, 10),
+ child: TextField(
+ key: const Key('day-sessions-search'),
+ controller: _searchController,
+ onChanged: (_) => setState(() {}),
+ decoration: InputDecoration(
+ hintText: l.statsSearchSessions,
+ prefixIcon: const Icon(Icons.search_rounded),
+ suffixIcon: _searchController.text.isEmpty
+ ? null
+ : IconButton(
+ onPressed: () {
+ _searchController.clear();
+ setState(() {});
+ },
+ icon: const Icon(Icons.clear_rounded),
+ ),
+ filled: true,
+ fillColor: cs.surfaceContainerHighest.withValues(
+ alpha: 0.45,
+ ),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(14),
+ borderSide: BorderSide.none,
+ ),
+ ),
+ ),
+ ),
+ if (!_loading && !_loadFailed && _sessions.isNotEmpty)
+ Padding(
+ padding: const EdgeInsets.fromLTRB(18, 0, 18, 8),
+ child: Row(
+ children: [
+ Text(
+ countLabel,
+ style: tt.labelMedium?.copyWith(
+ color: cs.onSurfaceVariant,
+ ),
+ ),
+ const Spacer(),
+ Text(
+ _formatDuration(totalSeconds, l),
+ style: tt.labelMedium?.copyWith(
+ color: cs.primary,
+ fontWeight: FontWeight.w700,
+ ),
+ ),
+ ],
+ ),
+ ),
+ Expanded(
+ child: _loading
+ ? const Center(child: CircularProgressIndicator())
+ : _loadFailed
+ ? Center(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Icon(
+ Icons.cloud_off_rounded,
+ size: 42,
+ color: cs.onSurfaceVariant,
+ ),
+ const SizedBox(height: 10),
+ Text(l.statsSessionsLoadFailed),
+ const SizedBox(height: 8),
+ TextButton(onPressed: _load, child: Text(l.retry)),
+ ],
+ ),
+ )
+ : filtered.isEmpty
+ ? Center(
+ child: Padding(
+ padding: const EdgeInsets.all(24),
+ child: Text(
+ _sessions.isEmpty
+ ? l.statsNoSessionsForDate
+ : l.statsNoSessionSearchResults,
+ textAlign: TextAlign.center,
+ style: tt.bodyMedium?.copyWith(
+ color: cs.onSurfaceVariant,
+ ),
+ ),
+ ),
+ )
+ : ListView.builder(
+ controller: scrollController,
+ padding: const EdgeInsets.fromLTRB(16, 0, 16, 28),
+ itemCount: filtered.length,
+ itemBuilder: (_, index) {
+ final session = filtered[index];
+ return ListeningSessionCard(
+ session: session,
+ onTap: () => _openSession(session),
+ );
+ },
+ ),
+ ),
+ ],
+ ),
+ );
+ },
+ );
+ }
+}
diff --git a/lib/widgets/library_books_tab.dart b/lib/widgets/library_books_tab.dart
index 0c879c8a..6f1661ac 100644
--- a/lib/widgets/library_books_tab.dart
+++ b/lib/widgets/library_books_tab.dart
@@ -10,6 +10,7 @@ class LibraryBooksTab extends StatelessWidget {
final LibraryFilter filter;
final String? genreFilter;
final String? tagFilter;
+ final bool isPodcastLibrary;
final bool rectangleCovers;
final double coverAspectRatio;
final Future<void> Function() onRefresh;
@@ -38,6 +39,7 @@ class LibraryBooksTab extends StatelessWidget {
required this.filter,
this.genreFilter,
this.tagFilter,
+ this.isPodcastLibrary = false,
required this.rectangleCovers,
required this.coverAspectRatio,
required this.onRefresh,
@@ -69,13 +71,34 @@ class LibraryBooksTab extends StatelessWidget {
],
);
} else if (items.isEmpty && !isLoadingPage) {
- final filterMsg = switch (filter) {
+ final filterMsg = isPodcastLibrary && filter != LibraryFilter.none
+ ? l.libraryNoItemsMatchingFilter
+ : switch (filter) {
+ LibraryFilter.notFinished => l.libraryNoUnfinishedBooks,
LibraryFilter.inProgress => l.libraryNoBooksInProgress,
LibraryFilter.finished => l.libraryNoFinishedBooks,
LibraryFilter.notStarted => l.libraryAllBooksStarted,
LibraryFilter.downloaded => l.libraryNoDownloadedBooks,
+ LibraryFilter.subscribed => l.libraryNoItemsMatchingFilter,
LibraryFilter.inASeries => l.libraryNoSeriesFound,
LibraryFilter.hasEbook => l.libraryNoBooksWithEbooks,
+ LibraryFilter.noEbook ||
+ LibraryFilter.hasSupplementaryEbook ||
+ LibraryFilter.noSupplementaryEbook ||
+ LibraryFilter.series ||
+ LibraryFilter.author ||
+ LibraryFilter.narrator ||
+ LibraryFilter.language ||
+ LibraryFilter.publisher ||
+ LibraryFilter.publishedDecade ||
+ LibraryFilter.noTracks ||
+ LibraryFilter.singleTrack ||
+ LibraryFilter.multipleTracks ||
+ LibraryFilter.abridged ||
+ LibraryFilter.issues ||
+ LibraryFilter.feedOpen ||
+ LibraryFilter.explicit => l.libraryNoItemsMatchingFilter,
+ LibraryFilter.missingMetadata => l.libraryNoBooksMissingMetadata,
LibraryFilter.genre => l.libraryNoBooksInGenre(genreFilter ?? l.genre.toLowerCase()),
LibraryFilter.tag => l.libraryNoBooksWithTag(tagFilter ?? l.tag.toLowerCase()),
LibraryFilter.none => l.libraryNoBooks,
diff --git a/lib/widgets/library_sort_filter_sheet.dart b/lib/widgets/library_sort_filter_sheet.dart
index 9572f8de..96b81414 100644
--- a/lib/widgets/library_sort_filter_sheet.dart
+++ b/lib/widgets/library_sort_filter_sheet.dart
@@ -15,18 +15,34 @@ class SortFilterSheet extends StatefulWidget {
final LibraryFilter currentFilter;
final String? genreFilter;
final String? tagFilter;
+ final String? filterValue;
+ final MissingMetadataField? missingMetadataFilter;
final List<String> availableGenres;
final List<String> availableTags;
+ final List<Map<String, String>> availableSeries;
+ final List<Map<String, String>> availableAuthors;
+ final List<String> availableNarrators;
+ final List<String> availableLanguages;
+ final List<String> availablePublishers;
+ final List<String> availablePublishedDecades;
final int initialTab;
final ColorScheme cs;
final TextTheme tt;
final void Function(LibrarySort) onSortChanged;
final VoidCallback onSortDirectionToggled;
- final void Function(LibraryFilter, {String? genre, String? tag}) onFilterChanged;
+ final void Function(
+ LibraryFilter, {
+ String? genre,
+ String? tag,
+ String? filterValue,
+ String? filterValueLabel,
+ MissingMetadataField? missingMetadata,
+ }) onFilterChanged;
final VoidCallback onClearFilter;
final bool collapseSeries;
final ValueChanged<bool> onCollapseSeriesChanged;
final bool isPodcastLibrary;
+ final bool canAccessExplicitContent;
final LibraryTab libraryTab;
final VoidCallback? onUpcomingReleases;
/// Series-tab progress filter (computed client-side). Optional so other
@@ -38,13 +54,22 @@ class SortFilterSheet extends StatefulWidget {
super.key,
required this.currentSort, required this.sortAsc,
required this.currentFilter, this.genreFilter, this.tagFilter,
+ this.filterValue,
+ this.missingMetadataFilter,
required this.availableGenres, this.availableTags = const [],
+ this.availableSeries = const [],
+ this.availableAuthors = const [],
+ this.availableNarrators = const [],
+ this.availableLanguages = const [],
+ this.availablePublishers = const [],
+ this.availablePublishedDecades = const [],
required this.initialTab,
required this.cs, required this.tt,
required this.onSortChanged, required this.onSortDirectionToggled,
required this.onFilterChanged, required this.onClearFilter,
this.collapseSeries = false, required this.onCollapseSeriesChanged,
required this.isPodcastLibrary,
+ this.canAccessExplicitContent = false,
this.libraryTab = LibraryTab.library,
this.onUpcomingReleases,
this.currentSeriesFilter = SeriesFilter.none,
@@ -59,10 +84,17 @@ class _SortFilterSheetState extends State<SortFilterSheet> with SingleTickerProv
late TabController _tabCtrl;
bool _genreExpanded = false;
bool _tagExpanded = false;
+ bool _missingMetadataExpanded = false;
+ bool _seriesExpanded = false;
+ bool _authorExpanded = false;
+ bool _narratorExpanded = false;
+ bool _languageExpanded = false;
+ bool _publisherExpanded = false;
+ bool _publishedDecadeExpanded = false;
late bool _collapseSeries;
bool get _showFilterTab =>
- (widget.libraryTab == LibraryTab.library && !widget.isPodcastLibrary) ||
+ widget.libraryTab == LibraryTab.library ||
(widget.libraryTab == LibraryTab.series &&
widget.onSeriesFilterChanged != null);
@@ -86,6 +118,23 @@ class _SortFilterSheetState extends State<SortFilterSheet> with SingleTickerProv
});
if (widget.currentFilter == LibraryFilter.genre) _genreExpanded = true;
if (widget.currentFilter == LibraryFilter.tag) _tagExpanded = true;
+ if (widget.currentFilter == LibraryFilter.missingMetadata) {
+ _missingMetadataExpanded = true;
+ }
+ if (widget.currentFilter == LibraryFilter.series) _seriesExpanded = true;
+ if (widget.currentFilter == LibraryFilter.author) _authorExpanded = true;
+ if (widget.currentFilter == LibraryFilter.narrator) {
+ _narratorExpanded = true;
+ }
+ if (widget.currentFilter == LibraryFilter.language) {
+ _languageExpanded = true;
+ }
+ if (widget.currentFilter == LibraryFilter.publisher) {
+ _publisherExpanded = true;
+ }
+ if (widget.currentFilter == LibraryFilter.publishedDecade) {
+ _publishedDecadeExpanded = true;
+ }
}
@override
@@ -156,8 +205,18 @@ class _SortFilterSheetState extends State<SortFilterSheet> with SingleTickerProv
if (widget.libraryTab == LibraryTab.authors) return 180;
if (widget.libraryTab == LibraryTab.narrators) return 130;
if (widget.libraryTab == LibraryTab.lists) return 230;
- if (_genreExpanded || _tagExpanded) return 420;
- return widget.isPodcastLibrary ? 200 : 440;
+ if (_genreExpanded ||
+ _tagExpanded ||
+ _missingMetadataExpanded ||
+ _seriesExpanded ||
+ _authorExpanded ||
+ _narratorExpanded ||
+ _languageExpanded ||
+ _publisherExpanded ||
+ _publishedDecadeExpanded) {
+ return 420;
+ }
+ return 440;
}
Widget _buildSortTab(ColorScheme cs, AppLocalizations l) {
@@ -282,17 +341,39 @@ class _SortFilterSheetState extends State<SortFilterSheet> with SingleTickerProv
return [
(LibrarySort.recentlyAdded, l.dateAdded, Icons.schedule_rounded),
(LibrarySort.alphabetical, l.title, Icons.sort_by_alpha_rounded),
+ (LibrarySort.authorName, l.author, Icons.person_rounded),
+ (LibrarySort.episodeCount, l.episodeCount, Icons.podcasts_rounded),
+ (LibrarySort.fileSize, l.fileSize, Icons.storage_rounded),
+ (LibrarySort.fileCreated, l.fileCreated, Icons.event_rounded),
+ (LibrarySort.lastModified, l.lastModified, Icons.update_rounded),
(LibrarySort.random, l.random, Icons.shuffle_rounded),
];
}
- return [
+ final options = <(LibrarySort, String, IconData)>[
(LibrarySort.recentlyAdded, l.dateAdded, Icons.schedule_rounded),
(LibrarySort.alphabetical, l.title, Icons.sort_by_alpha_rounded),
- (LibrarySort.authorName, l.author, Icons.person_rounded),
+ (LibrarySort.authorFirstLast, l.authorFirstLast, Icons.person_rounded),
+ (LibrarySort.authorName, l.authorLastFirst, Icons.person_outline_rounded),
(LibrarySort.publishedYear, l.publishedYear, Icons.calendar_today_rounded),
(LibrarySort.duration, l.duration, Icons.timelapse_rounded),
+ (LibrarySort.fileSize, l.fileSize, Icons.storage_rounded),
+ (LibrarySort.lastUpdated, l.lastUpdated, Icons.sync_rounded),
+ (LibrarySort.fileCreated, l.fileCreated, Icons.event_rounded),
+ (LibrarySort.lastModified, l.lastModified, Icons.update_rounded),
+ (LibrarySort.progress, l.progressSort, Icons.percent_rounded),
+ (LibrarySort.dateStarted, l.dateStarted, Icons.play_arrow_rounded),
+ (LibrarySort.dateFinished, l.dateFinished, Icons.done_all_rounded),
(LibrarySort.random, l.random, Icons.shuffle_rounded),
];
+ if (widget.currentFilter == LibraryFilter.series &&
+ widget.filterValue != null &&
+ widget.filterValue != 'no-series') {
+ options.insert(
+ options.length - 1,
+ (LibrarySort.sequence, l.sequence, Icons.format_list_numbered_rounded),
+ );
+ }
+ return options;
}
}
@@ -300,13 +381,39 @@ class _SortFilterSheetState extends State<SortFilterSheet> with SingleTickerProv
if (widget.libraryTab == LibraryTab.series) {
return _buildSeriesFilterTab(cs, l);
}
+ if (widget.isPodcastLibrary) {
+ return _buildPodcastFilterTab(cs, l);
+ }
final filters = <(LibraryFilter, String, IconData)>[
+ (LibraryFilter.notFinished, l.notFinished, Icons.pending_outlined),
(LibraryFilter.inProgress, l.inProgress, Icons.play_circle_outline_rounded),
(LibraryFilter.finished, l.filterFinished, Icons.check_circle_outline_rounded),
(LibraryFilter.notStarted, l.notStarted, Icons.circle_outlined),
(LibraryFilter.downloaded, l.downloaded, Icons.download_done_rounded),
(LibraryFilter.hasEbook, l.hasEbook, Icons.menu_book_rounded),
+ (LibraryFilter.noEbook, l.noEbook, Icons.menu_book_outlined),
+ (
+ LibraryFilter.hasSupplementaryEbook,
+ l.hasSupplementaryEbook,
+ Icons.library_add_check_rounded,
+ ),
+ (
+ LibraryFilter.noSupplementaryEbook,
+ l.noSupplementaryEbook,
+ Icons.library_add_outlined,
+ ),
+ (LibraryFilter.noTracks, l.noTracks, Icons.music_off_rounded),
+ (LibraryFilter.singleTrack, l.singleTrack, Icons.audiotrack_rounded),
+ (LibraryFilter.multipleTracks, l.multipleTracks, Icons.queue_music_rounded),
+ (LibraryFilter.abridged, l.abridged, Icons.content_cut_rounded),
+ (LibraryFilter.issues, l.issues, Icons.warning_amber_rounded),
+ (LibraryFilter.feedOpen, l.rssFeedOpen, Icons.rss_feed_rounded),
];
+ if (widget.canAccessExplicitContent) {
+ filters.add(
+ (LibraryFilter.explicit, l.explicitContent, Icons.explicit_rounded),
+ );
+ }
return ListView(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
children: [
@@ -334,6 +441,99 @@ class _SortFilterSheetState extends State<SortFilterSheet> with SingleTickerProv
onTap: () => widget.onFilterChanged(filter),
);
}),
+ ..._buildSeriesFilterSection(cs, l),
+ ..._buildNamedFilterSection(
+ cs: cs,
+ label: l.libraryTabAuthors,
+ icon: Icons.person_rounded,
+ filter: LibraryFilter.author,
+ values: widget.availableAuthors,
+ expanded: _authorExpanded,
+ onToggle: () => setState(() => _authorExpanded = !_authorExpanded),
+ ),
+ ..._buildStringFilterSection(
+ cs: cs,
+ label: l.libraryTabNarrators,
+ icon: Icons.record_voice_over_rounded,
+ filter: LibraryFilter.narrator,
+ values: widget.availableNarrators,
+ expanded: _narratorExpanded,
+ onToggle: () => setState(
+ () => _narratorExpanded = !_narratorExpanded,
+ ),
+ ),
+ ..._buildStringFilterSection(
+ cs: cs,
+ label: l.languageLabel,
+ icon: Icons.language_rounded,
+ filter: LibraryFilter.language,
+ values: widget.availableLanguages,
+ expanded: _languageExpanded,
+ onToggle: () => setState(
+ () => _languageExpanded = !_languageExpanded,
+ ),
+ ),
+ ..._buildStringFilterSection(
+ cs: cs,
+ label: l.publisherLabel,
+ icon: Icons.business_rounded,
+ filter: LibraryFilter.publisher,
+ values: widget.availablePublishers,
+ expanded: _publisherExpanded,
+ onToggle: () => setState(
+ () => _publisherExpanded = !_publisherExpanded,
+ ),
+ ),
+ ..._buildStringFilterSection(
+ cs: cs,
+ label: l.publishedDecade,
+ icon: Icons.date_range_rounded,
+ filter: LibraryFilter.publishedDecade,
+ values: widget.availablePublishedDecades,
+ expanded: _publishedDecadeExpanded,
+ onToggle: () => setState(
+ () => _publishedDecadeExpanded = !_publishedDecadeExpanded,
+ ),
+ valueLabel: (value) => '${value}s',
+ ),
+ SheetOption(
+ icon: Icons.manage_search_rounded,
+ label: l.missingMetadata,
+ selected: widget.currentFilter == LibraryFilter.missingMetadata,
+ selectedColor: cs.tertiary,
+ trailing: Icon(
+ _missingMetadataExpanded
+ ? Icons.expand_less_rounded
+ : Icons.expand_more_rounded,
+ size: 20,
+ color: cs.onSurfaceVariant,
+ ),
+ onTap: () => setState(
+ () => _missingMetadataExpanded = !_missingMetadataExpanded,
+ ),
+ ),
+ if (_missingMetadataExpanded)
+ Padding(
+ padding: const EdgeInsets.only(left: 16),
+ child: Column(
+ children: MissingMetadataField.values.map((field) {
+ final selected =
+ widget.currentFilter == LibraryFilter.missingMetadata &&
+ widget.missingMetadataFilter == field;
+ return SheetOption(
+ icon: Icons.error_outline_rounded,
+ label: missingMetadataFieldLabel(l, field),
+ selected: selected,
+ selectedColor: cs.tertiary,
+ compact: true,
+ onTap: () => widget.onFilterChanged(
+ LibraryFilter.missingMetadata,
+ missingMetadata: field,
+ ),
+ );
+ }).toList(),
+ ),
+ ),
SheetOption(
icon: Icons.category_rounded,
label: l.genre,
@@ -386,11 +586,281 @@ class _SortFilterSheetState extends State<SortFilterSheet> with SingleTickerProv
);
}
+ Widget _buildPodcastFilterTab(ColorScheme cs, AppLocalizations l) {
+ final filters = <(LibraryFilter, String, IconData)>[
+ (
+ LibraryFilter.subscribed,
+ l.episodeListSubscribedChip,
+ Icons.notifications_active_outlined,
+ ),
+ (LibraryFilter.issues, l.issues, Icons.warning_amber_rounded),
+ (LibraryFilter.feedOpen, l.rssFeedOpen, Icons.rss_feed_rounded),
+ ];
+ if (widget.canAccessExplicitContent) {
+ filters.add(
+ (LibraryFilter.explicit, l.explicitContent, Icons.explicit_rounded),
+ );
+ }
+ return ListView(
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
+ children: [
+ if (widget.currentFilter != LibraryFilter.none)
+ Padding(
+ padding: const EdgeInsets.only(bottom: 8),
+ child: GestureDetector(
+ onTap: widget.onClearFilter,
+ child: Container(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 14,
+ vertical: 10,
+ ),
+ decoration: BoxDecoration(
+ color: cs.errorContainer.withValues(alpha: 0.4),
+ borderRadius: BorderRadius.circular(14),
+ ),
+ child: Row(children: [
+ Icon(Icons.clear_rounded, size: 18, color: cs.error),
+ const SizedBox(width: 10),
+ Text(
+ l.clearFilter,
+ style: TextStyle(
+ fontSize: 14,
+ fontWeight: FontWeight.w600,
+ color: cs.error,
+ ),
+ ),
+ ]),
+ ),
+ ),
+ ),
+ ...filters.map((f) {
+ final (filter, label, icon) = f;
+ return SheetOption(
+ icon: icon,
+ label: label,
+ selected: filter == widget.currentFilter,
+ selectedColor: cs.tertiary,
+ onTap: () => widget.onFilterChanged(filter),
+ );
+ }),
+ ..._buildStringFilterSection(
+ cs: cs,
+ label: l.genre,
+ icon: Icons.category_rounded,
+ optionIcon: Icons.label_outline_rounded,
+ filter: LibraryFilter.genre,
+ values: widget.availableGenres,
+ expanded: _genreExpanded,
+ onToggle: () => setState(() => _genreExpanded = !_genreExpanded),
+ onSelected: (value, _) => widget.onFilterChanged(
+ LibraryFilter.genre,
+ genre: value,
+ ),
+ ),
+ ..._buildStringFilterSection(
+ cs: cs,
+ label: l.tag,
+ icon: Icons.local_offer_rounded,
+ optionIcon: Icons.local_offer_outlined,
+ filter: LibraryFilter.tag,
+ values: widget.availableTags,
+ expanded: _tagExpanded,
+ onToggle: () => setState(() => _tagExpanded = !_tagExpanded),
+ onSelected: (value, _) => widget.onFilterChanged(
+ LibraryFilter.tag,
+ tag: value,
+ ),
+ ),
+ ..._buildStringFilterSection(
+ cs: cs,
+ label: l.languageLabel,
+ icon: Icons.language_rounded,
+ filter: LibraryFilter.language,
+ values: widget.availableLanguages,
+ expanded: _languageExpanded,
+ onToggle: () => setState(
+ () => _languageExpanded = !_languageExpanded,
+ ),
+ ),
+ ],
+ );
+ }
+
+ List<Widget> _buildSeriesFilterSection(
+ ColorScheme cs,
+ AppLocalizations l,
+ ) {
+ final values = <Map<String, String>>[
+ {'id': 'no-series', 'name': l.noSeries},
+ ...widget.availableSeries,
+ ];
+ return [
+ SheetOption(
+ icon: Icons.auto_stories_rounded,
+ label: l.libraryTabSeries,
+ selected: widget.currentFilter == LibraryFilter.series,
+ selectedColor: cs.tertiary,
+ trailing: Icon(
+ _seriesExpanded
+ ? Icons.expand_less_rounded
+ : Icons.expand_more_rounded,
+ size: 20,
+ color: cs.onSurfaceVariant,
+ ),
+ onTap: () => setState(() => _seriesExpanded = !_seriesExpanded),
+ ),
+ if (_seriesExpanded)
+ Padding(
+ padding: const EdgeInsets.only(left: 16),
+ child: Column(
+ children: values.map((series) {
+ final id = series['id']!;
+ final name = series['name']!;
+ final selected =
+ widget.currentFilter == LibraryFilter.series &&
+ widget.filterValue == id;
+ return SheetOption(
+ icon: Icons.book_outlined,
+ label: name,
+ selected: selected,
+ selectedColor: cs.tertiary,
+ compact: true,
+ marquee: true,
+ onTap: () => widget.onFilterChanged(
+ LibraryFilter.series,
+ filterValue: id,
+ filterValueLabel: name,
+ ),
+ );
+ }).toList(),
+ ),
+ ),
+ ];
+ }
+
+ List<Widget> _buildStringFilterSection({
+ required ColorScheme cs,
+ required String label,
+ required IconData icon,
+ required LibraryFilter filter,
+ required List<String> values,
+ required bool expanded,
+ required VoidCallback onToggle,
+ IconData optionIcon = Icons.label_outline_rounded,
+ String Function(String)? valueLabel,
+ void Function(String value, String label)? onSelected,
+ }) {
+ if (values.isEmpty) return const [];
+ final displayLabel = valueLabel ?? (value) => value;
+ return [
+ SheetOption(
+ icon: icon,
+ label: label,
+ selected: widget.currentFilter == filter,
+ selectedColor: cs.tertiary,
+ trailing: Icon(
+ expanded ? Icons.expand_less_rounded : Icons.expand_more_rounded,
+ size: 20,
+ color: cs.onSurfaceVariant,
+ ),
+ onTap: onToggle,
+ ),
+ if (expanded)
+ Padding(
+ padding: const EdgeInsets.only(left: 16),
+ child: Column(
+ children: values.map((value) {
+ final shown = displayLabel(value);
+ final selected =
+ widget.currentFilter == filter &&
+ (filter == LibraryFilter.genre
+ ? widget.genreFilter == value
+ : filter == LibraryFilter.tag
+ ? widget.tagFilter == value
+ : widget.filterValue == value);
+ return SheetOption(
+ icon: optionIcon,
+ label: shown,
+ selected: selected,
+ selectedColor: cs.tertiary,
+ compact: true,
+ marquee: true,
+ onTap: () {
+ if (onSelected != null) {
+ onSelected(value, shown);
+ } else {
+ widget.onFilterChanged(
+ filter,
+ filterValue: value,
+ filterValueLabel: shown,
+ );
+ }
+ },
+ );
+ }).toList(),
+ ),
+ ),
+ ];
+ }
+
+ List<Widget> _buildNamedFilterSection({
+ required ColorScheme cs,
+ required String label,
+ required IconData icon,
+ required LibraryFilter filter,
+ required List<Map<String, String>> values,
+ required bool expanded,
+ required VoidCallback onToggle,
+ }) {
+ if (values.isEmpty) return const [];
+ return [
+ SheetOption(
+ icon: icon,
+ label: label,
+ selected: widget.currentFilter == filter,
+ selectedColor: cs.tertiary,
+ trailing: Icon(
+ expanded ? Icons.expand_less_rounded : Icons.expand_more_rounded,
+ size: 20,
+ color: cs.onSurfaceVariant,
+ ),
+ onTap: onToggle,
+ ),
+ if (expanded)
+ Padding(
+ padding: const EdgeInsets.only(left: 16),
+ child: Column(
+ children: values.map((value) {
+ final id = value['id']!;
+ final name = value['name']!;
+ final selected =
+ widget.currentFilter == filter &&
+ widget.filterValue == id;
+ return SheetOption(
+ icon: Icons.label_outline_rounded,
+ label: name,
+ selected: selected,
+ selectedColor: cs.tertiary,
+ compact: true,
+ marquee: true,
+ onTap: () => widget.onFilterChanged(
+ filter,
+ filterValue: id,
+ filterValueLabel: name,
+ ),
+ );
+ }).toList(),
+ ),
+ ),
+ ];
+ }
+
/// Series-tab filter UI. ABS doesn't expose progress filters on series
/// server-side, so absorb computes these client-side from per-book
/// progress (handled in library_screen.dart).
Widget _buildSeriesFilterTab(ColorScheme cs, AppLocalizations l) {
final filters = <(SeriesFilter, String, IconData)>[
+ (SeriesFilter.notFinished, l.notFinished, Icons.pending_outlined),
(SeriesFilter.inProgress, l.inProgress, Icons.play_circle_outline_rounded),
(SeriesFilter.finished, l.filterFinished, Icons.check_circle_outline_rounded),
(SeriesFilter.notStarted, l.notStarted, Icons.circle_outlined),
diff --git a/lib/widgets/podcast_episode_feed.dart b/lib/widgets/podcast_episode_feed.dart
index c3cf0958..be3d4460 100644
--- a/lib/widgets/podcast_episode_feed.dart
+++ b/lib/widgets/podcast_episode_feed.dart
@@ -15,6 +15,22 @@ import 'episode_list_sheet.dart';
import 'episode_row.dart';
import 'overlay_toast.dart';
+bool podcastEpisodeMatchesFilter(
+ String filter, {
+ required double progress,
+ required bool finished,
+ required bool downloaded,
+ required bool subscribed,
+}) => switch (filter) {
+ 'downloaded' => downloaded,
+ 'subscribed' => subscribed,
+ 'notfinished' => !finished,
+ 'unplayed' => progress <= 0 && !finished,
+ 'inprogress' => progress > 0 && !finished,
+ 'finished' => finished,
+ _ => true,
+};
+
/// Recent-episodes feed for podcast libraries (the "Episodes" pill): the
/// library's newest episodes across all shows, with quick filters and swipe
/// actions (mark played / download).
@@ -50,7 +66,10 @@ class _PodcastEpisodeFeedState extends State<PodcastEpisodeFeed> {
void initState() {
super.initState();
ScopedPrefs.getString('episode_feed_filter_${widget.libraryId}').then((v) {
- if (mounted && v != null && v.isNotEmpty) setState(() => _filter = v);
+ if (mounted && v != null && v.isNotEmpty) {
+ setState(() => _filter = v);
+ _fillFilteredResults();
+ }
});
_scroll.addListener(_onScroll);
_loadPage();
@@ -92,6 +111,7 @@ class _PodcastEpisodeFeedState extends State<PodcastEpisodeFeed> {
_loading = false;
_loadingMore = false;
});
+ _fillFilteredResults();
}
Future<void> _refresh() async {
@@ -105,6 +125,22 @@ class _PodcastEpisodeFeedState extends State<PodcastEpisodeFeed> {
if (f == _filter) return;
setState(() => _filter = f);
ScopedPrefs.setString('episode_feed_filter_${widget.libraryId}', f);
+ _fillFilteredResults();
+ }
+
+ void _fillFilteredResults() {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (!mounted ||
+ _filter == 'all' ||
+ !_hasMore ||
+ _loading ||
+ _loadingMore) {
+ return;
+ }
+ final lib = context.read<LibraryProvider>();
+ final matchCount = _episodes.where((ep) => _matchesFilter(lib, ep)).length;
+ if (matchCount < 20) _loadPage();
+ });
}
String _showIdOf(Map<String, dynamic> ep) =>
@@ -175,18 +211,18 @@ class _PodcastEpisodeFeedState extends State<PodcastEpisodeFeed> {
}
bool _matchesFilter(LibraryProvider lib, Map<String, dynamic> ep) {
- if (_filter == 'all') return true;
final showId = _showIdOf(ep);
final epId = ep['id'] as String? ?? '';
- if (_filter == 'downloaded') {
- return DownloadService().isDownloaded('$showId-$epId');
- }
final progress = lib.getEpisodeProgress(showId, epId);
final finished =
lib.getEpisodeProgressData(showId, epId)?['isFinished'] == true;
- if (_filter == 'unplayed') return progress <= 0 && !finished;
- if (_filter == 'inprogress') return progress > 0 && !finished;
- return true;
+ return podcastEpisodeMatchesFilter(
+ _filter,
+ progress: progress,
+ finished: finished,
+ downloaded: DownloadService().isDownloaded('$showId-$epId'),
+ subscribed: lib.isPodcastSubscribed(showId),
+ );
}
Future<void> _playEpisode(Map<String, dynamic> ep) async {
@@ -325,8 +361,11 @@ class _PodcastEpisodeFeedState extends State<PodcastEpisodeFeed> {
children: [
for (final (key, label) in [
('all', l.filterAllEpisodes),
+ ('subscribed', l.episodeListSubscribedChip),
+ ('notfinished', l.notFinished),
('unplayed', l.filterUnplayed),
('inprogress', l.inProgress),
+ ('finished', l.filterFinished),
('downloaded', l.downloaded),
]) ...[
ChoiceChip(