@@ -59,7 +59,7 @@ void SongListLayer::addSongsToScrollLayer(geode::ScrollLayer* scrollLayer, SongM
5959
6060 songData.displayName = SongListLayer::generateDisplayName (songData);
6161
62- if (SAVED (" songListSortSongLength" )) songData.songLength = SongListLayer::getLength (songFilePath , reverse);
62+ if (SAVED (" songListSortSongLength" )) songData.songLength = SongListLayer::getLength (songData. actualFilePath , reverse);
6363
6464 if (!queryString.empty ()) {
6565 const bool contains = geode::utils::string::contains (geode::utils::string::toLower (songData.displayName ), geode::utils::string::toLower (queryString));
@@ -604,20 +604,18 @@ bool SongListLayer::songLength(MLRSongCell* a, MLRSongCell* b, const bool revers
604604 return a->m_songData .actualFilePath < b->m_songData .actualFilePath ;
605605}
606606
607- unsigned int SongListLayer::getLength (const std::filesystem::path & path, const bool reverse) {
607+ unsigned int SongListLayer::getLength (const std::string& path, const bool reverse) {
608608 const double extreme = reverse ? std::numeric_limits<double >::min () : std::numeric_limits<double >::max ();
609609 ma_decoder decoder;
610- if (ma_decoder_init_file (path.string ().c_str (), nullptr , &decoder) != MA_SUCCESS) {
611- return extreme;
612- }
610+ if (ma_decoder_init_file (path.c_str (), nullptr , &decoder) != MA_SUCCESS) return extreme;
613611
614612 ma_uint64 frames = 0 ;
615613 if (ma_decoder_get_length_in_pcm_frames (&decoder, &frames) != MA_SUCCESS) {
616614 ma_decoder_uninit (&decoder);
617615 return extreme;
618616 }
619617
620- ma_uint32 sampleRate = decoder.outputSampleRate ;
618+ const ma_uint32 sampleRate = decoder.outputSampleRate ;
621619 ma_decoder_uninit (&decoder);
622620
623621 if (sampleRate == 0 ) return extreme;
0 commit comments