Commit ad92592 1 parent 6eb266e commit ad92592 Copy full SHA for ad92592
File tree 4 files changed +17
-11
lines changed
4 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -2001,7 +2001,9 @@ extension TrackToAudioSourceMediaItem on Selectable {
2001
2001
MediaItem toMediaItem (int currentIndex, int queueLength, Duration ? duration) {
2002
2002
final tr = track.toTrackExt ();
2003
2003
final artist = tr.originalArtist == '' ? UnknownTags .ARTIST : tr.originalArtist;
2004
- final imagePage = tr.pathToImage;
2004
+ final imagePath = tr.pathToImage;
2005
+ String ? imagePathToUse = File (imagePath).existsSync () ? imagePath : null ;
2006
+ imagePathToUse ?? = Indexer .inst.getFallbackFolderArtworkPath (folderPath: tr.folderPath);
2005
2007
return MediaItem (
2006
2008
id: tr.path,
2007
2009
title: tr.title,
@@ -2012,7 +2014,7 @@ extension TrackToAudioSourceMediaItem on Selectable {
2012
2014
album: tr.hasUnknownAlbum ? '' : tr.album,
2013
2015
genre: tr.originalGenre,
2014
2016
duration: duration ?? Duration (milliseconds: tr.durationMS),
2015
- artUri: Uri .file (File (imagePage). existsSync () ? imagePage : AppPaths .NAMIDA_LOGO_MONET ),
2017
+ artUri: Uri .file (imagePathToUse ?? AppPaths .NAMIDA_LOGO_MONET ),
2016
2018
);
2017
2019
}
2018
2020
}
Original file line number Diff line number Diff line change @@ -105,6 +105,17 @@ class Indexer<T extends Track> {
105
105
106
106
bool imageObtainedBefore (String imagePath) => _artworksMap[imagePath] != null || _artworksMapFullRes[imagePath] != null ;
107
107
108
+ String ? getFallbackFolderArtworkPath ({required String folderPath}) {
109
+ String ? cover = this .allFolderCovers[folderPath];
110
+ if (cover == null && folderPath.endsWith (Platform .pathSeparator)) {
111
+ try {
112
+ folderPath = folderPath.substring (0 , folderPath.length - 1 );
113
+ cover = this .allFolderCovers[folderPath];
114
+ } catch (_) {}
115
+ }
116
+ return cover;
117
+ }
118
+
108
119
/// {imagePath: (TrackExtended, id)};
109
120
final _backupMediaStoreIDS = < String , (Track , int )> {};
110
121
final artworksMap = < String , Uint8List ? > {};
Original file line number Diff line number Diff line change @@ -153,14 +153,7 @@ class _ArtworkWidgetState extends State<ArtworkWidget> with LoadingItemsDelayMix
153
153
}
154
154
155
155
if (_imagePath == null && widget.track != null && widget.fallbackToFolderCover) {
156
- String folderPath = widget.track! .folderPath;
157
- String ? cover = Indexer .inst.allFolderCovers[folderPath];
158
- if (cover == null && folderPath.endsWith (Platform .pathSeparator)) {
159
- try {
160
- folderPath = folderPath.substring (0 , folderPath.length - 1 );
161
- cover = Indexer .inst.allFolderCovers[folderPath];
162
- } catch (_) {}
163
- }
156
+ final cover = Indexer .inst.getFallbackFolderArtworkPath (folderPath: widget.track! .folderPath);
164
157
if (cover != null && mounted) setState (() => _imagePath = cover);
165
158
}
166
159
}
Original file line number Diff line number Diff line change 1
1
name : namida
2
2
description : A Beautiful and Feature-rich Music Player, With YouTube & Video Support Built in Flutter
3
3
publish_to : " none"
4
- version : 4.9.2-beta+250118221
4
+ version : 4.9.2-beta+250118223
5
5
6
6
environment :
7
7
sdk : " >=3.6.0 <4.0.0"
You can’t perform that action at this time.
0 commit comments