diff --git a/CHANGELOG.md b/CHANGELOG.md
index df60d887d..bf204808f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### Fixed
- albums: show groups to move/copy/export items
+- albums: hide grouped albums containing hidden items only
## [v1.13.0] - 2025-05-12
diff --git a/lib/widgets/filter_grids/albums_page.dart b/lib/widgets/filter_grids/albums_page.dart
index 0c2875080..01ceee68c 100644
--- a/lib/widgets/filter_grids/albums_page.dart
+++ b/lib/widgets/filter_grids/albums_page.dart
@@ -111,21 +111,25 @@ class AlbumListPage extends StatelessWidget {
final listedStoredAlbums = {};
if (albumChipTypes.contains(AlbumChipType.stored)) {
+ final allAlbums = source.rawAlbums;
if (groupUri == null) {
final withinGroups = whereTypeRecursively(groupContent).map((v) => v.album).toSet();
- listedStoredAlbums.addAll(source.rawAlbums.whereNot(withinGroups.contains));
+ listedStoredAlbums.addAll(allAlbums.whereNot(withinGroups.contains));
} else {
- listedStoredAlbums.addAll(groupContent.whereType().map((v) => v.album));
+ // check that group content is listed from source, to prevent displaying hidden content
+ listedStoredAlbums.addAll(groupContent.whereType().map((v) => v.album).where(allAlbums.contains));
}
}
final listedDynamicAlbums = {};
if (albumChipTypes.contains(AlbumChipType.dynamic)) {
+ final allDynamicAlbums = dynamicAlbums.all;
if (groupUri == null) {
final withinGroups = whereTypeRecursively(groupContent).toSet();
- listedDynamicAlbums.addAll(dynamicAlbums.all.whereNot(withinGroups.contains));
+ listedDynamicAlbums.addAll(allDynamicAlbums.whereNot(withinGroups.contains));
} else {
- listedDynamicAlbums.addAll(groupContent.whereType());
+ // check that group content is listed from source, to prevent displaying hidden content
+ listedDynamicAlbums.addAll(groupContent.whereType().where(allDynamicAlbums.contains));
}
}