File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -186,14 +186,11 @@ void SongList::ScanFolder(const std::filesystem::path &folder) {
186186 if (std::filesystem::exists (infoPath)) {
187187 song.songInfoPath = (folder / " info.json" );
188188 song.songDir = folder.string ();
189- if (std::filesystem::exists (folder / " cover.png" )) {
190- song.albumArtPath = (folder / " cover.png" ).string ();
191- }
192- if (std::filesystem::exists (folder / " cover.jpg" )) {
193- song.albumArtPath = (folder / " cover.jpg" ).string ();
194- }
195- if (std::filesystem::exists (folder / " cover.jpeg" )) {
196- song.albumArtPath = (folder / " cover.jpeg" ).string ();
189+ for (auto &file : std::filesystem::directory_iterator (folder)) {
190+ if (file.path ().stem () == " cover" ) {
191+ song.albumArtPath = file.path ().string ();
192+ break ;
193+ }
197194 }
198195 song.LoadSongJSON (song.songInfoPath );
199196 } else if (std::filesystem::exists (folder / " song.ini" )) {
You can’t perform that action at this time.
0 commit comments