Ignore files w/o fileId when working out album cover

This commit is contained in:
Ming Ming 2023-04-29 01:27:46 +08:00
parent 53b51b77b1
commit c4887faf33

View file

@ -80,7 +80,8 @@ class AlbumAutoCoverProvider extends AlbumCoverProvider {
.map((e) => e.file) .map((e) => e.file)
.where((element) => .where((element) =>
file_util.isSupportedFormat(element) && file_util.isSupportedFormat(element) &&
(element.hasPreview ?? false)) (element.hasPreview ?? false) &&
element.fileId != null)
.sorted(compareFileDateTimeDescending) .sorted(compareFileDateTimeDescending)
.firstOrNull; .firstOrNull;
} }