Fix delete empty album

This commit is contained in:
Neeraj Gupta 2023-01-17 13:13:11 +05:30
parent 593ad5e83d
commit 84e40d6d31
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -87,9 +87,10 @@ class _DeleteEmptyAlbumsState extends State<DeleteEmptyAlbums> {
Future<void> _deleteEmptyAlbums() async {
final collections =
await CollectionsService.instance.getCollectionsWithThumbnails();
// remove collections which are not empty or can't be deleted
collections.removeWhere(
(element) =>
element.thumbnail != null || element.collection.type.canDelete,
element.thumbnail != null || !element.collection.type.canDelete,
);
int failedCount = 0;
for (int i = 0; i < collections.length; i++) {