@@ -1213,19 +1213,13 @@ Future<void> _loadSongs() async {
1213
1213
final prefs = await SharedPreferences .getInstance ();
1214
1214
int currentCount = 0 ;
1215
1215
List <Song > loadedSongs = [];
1216
+ if (prefs.getBool ('autoConvert' ) ?? false ) {
1216
1217
do {
1217
1218
final metadata = await rust_api.scanMusicDirectory (
1218
1219
dirPath: currentMusicDirectory,
1219
- autoConvert: prefs.getBool ('autoConvert' ) ?? true ,
1220
+ autoConvert: prefs.getBool ('autoConvert' ) ?? false ,
1220
1221
);
1221
- final paths = metadata.map ((m) => m.path).toList ();
1222
- final cacheDir = await getTemporaryDirectory ();
1223
- final artistCacheDir = '${cacheDir .path }/artist_cache' ;
1224
- final artistMap = await rust_api.batchGetArtists (
1225
- paths: paths,
1226
- cacheDir: artistCacheDir,
1227
- );
1228
- loadedSongs = metadata.map ((m) => Song .fromMetadata (m, artists: artistMap[m.path] ?? [m.artist])).toList ();
1222
+ loadedSongs = metadata.map ((m) => Song .fromMetadata (m)).toList ();
1229
1223
currentCount = loadedSongs.length;
1230
1224
setState (() {
1231
1225
songs = loadedSongs;
@@ -1240,6 +1234,7 @@ Future<void> _loadSongs() async {
1240
1234
await Future .delayed (const Duration (seconds: 1 ));
1241
1235
}
1242
1236
} while (currentCount >= expectedCount);
1237
+ }
1243
1238
loadedSongs.sort ((a, b) => a.title.compareTo (b.title));
1244
1239
} catch (e) {
1245
1240
print ('Error loading songs: $e ' );
@@ -2998,7 +2993,7 @@ Widget _buildSettingsSwitch(
2998
2993
final textColor =
2999
2994
_currentColor.computeLuminance () > 0.007 ? _currentColor : Colors .white;
3000
2995
final buttonTextColor =
3001
- _currentColor.computeLuminance () > 0.5 ? Colors .black : Colors .white;
2996
+ _currentColor.computeLuminance () > 0.007 ? Colors .black : Colors .white;
3002
2997
3003
2998
return RawKeyboardListener (
3004
2999
focusNode: FocusNode (),
@@ -3534,7 +3529,7 @@ Widget _buildSettingsSwitch(
3534
3529
required VoidCallback onPressed,
3535
3530
}) {
3536
3531
final textColor =
3537
- _currentColor.computeLuminance () > 0.5 ? Colors .black : Colors .white;
3532
+ _currentColor.computeLuminance () > 0.007 ? Colors .black : Colors .white;
3538
3533
3539
3534
return Material (
3540
3535
color: Colors .transparent,
@@ -5573,10 +5568,7 @@ class _DownloadScreenState extends State<DownloadScreen>
5573
5568
);
5574
5569
5575
5570
if (metadata.isNotEmpty) {
5576
- final artists = await rust_api.getArtistViaFfprobe (
5577
- filePath: downloadedPath,
5578
- );
5579
- _tempSong = Song .fromMetadata (metadata.first, artists: artists);
5571
+ _tempSong = Song .fromMetadata (metadata.first);
5580
5572
5581
5573
if (_tempSong! .albumArt != null ) {
5582
5574
try {
@@ -5600,8 +5592,8 @@ class _DownloadScreenState extends State<DownloadScreen>
5600
5592
onReloadLibrary: widget.onReloadLibrary,
5601
5593
musicFolder: widget.musicFolder,
5602
5594
service: widget.service,
5603
- song: Song .fromMetadata (metadata.first, artists : artists ),
5604
- songList: [Song .fromMetadata (metadata.first, artists : artists )],
5595
+ song: Song .fromMetadata (metadata.first),
5596
+ songList: [Song .fromMetadata (metadata.first)],
5605
5597
currentIndex: 0 ,
5606
5598
isTemp: true ,
5607
5599
tempPath: downloadedPath,
0 commit comments