fix initialisation of playlist widget
This commit is contained in:
parent
7381eec249
commit
261b8e13d6
3 changed files with 21 additions and 16 deletions
|
@ -69,7 +69,9 @@ class LocalMusicFetcherImpl implements LocalMusicFetcher {
|
|||
final Set<String> songFilePaths = {};
|
||||
for (final libDir in libDirs) {
|
||||
_log.d('Checking folder: ${libDir.path}');
|
||||
songFilePaths.addAll(await getSongFilesInDirectory(libDir.path, allowedExtensions, blockedPaths));
|
||||
songFilePaths.addAll(
|
||||
await getSongFilesInDirectory(libDir.path, allowedExtensions, blockedPaths),
|
||||
);
|
||||
}
|
||||
final List<File> songFiles = songFilePaths.map((e) => File(e)).toList();
|
||||
|
||||
|
@ -166,18 +168,22 @@ class LocalMusicFetcherImpl implements LocalMusicFetcher {
|
|||
artists.add(ArtistModel(name: artistName, id: newArtistId++));
|
||||
}
|
||||
|
||||
albums.add(AlbumModel.fromMetadata(
|
||||
albums.add(
|
||||
AlbumModel.fromMetadata(
|
||||
songData: songData,
|
||||
albumId: albumId,
|
||||
albumArtPath: albumArtMap[albumId],
|
||||
));
|
||||
songs.add(SongModel.fromMetadata(
|
||||
),
|
||||
);
|
||||
songs.add(
|
||||
SongModel.fromMetadata(
|
||||
path: songFile.path,
|
||||
songData: songData,
|
||||
albumId: albumId,
|
||||
lastModified: lastModified,
|
||||
albumArtPath: albumArtMap[albumId],
|
||||
));
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_log.d('Songs in list: ${songs.length}');
|
||||
|
|
|
@ -37,8 +37,7 @@ class AlbumModel extends Album {
|
|||
String? albumArtPath,
|
||||
Color? color,
|
||||
}) {
|
||||
final albumArtist = songData.albumArtist ?? '';
|
||||
final artist = albumArtist != '' ? albumArtist : songData.artist;
|
||||
final artist = songData.albumArtist ?? songData.artist;
|
||||
|
||||
return AlbumModel(
|
||||
id: albumId,
|
||||
|
|
|
@ -37,7 +37,7 @@ class InitRepositoryImpl extends InitRepository {
|
|||
3,
|
||||
L10n.of(context)!.yourPlaylists,
|
||||
HomePlaylistsOrder.history,
|
||||
OrderDirection.ascending,
|
||||
OrderDirection.descending,
|
||||
HomePlaylistsFilter.both,
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue