mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
fix: local track metadata timeout
This commit is contained in:
parent
0d9fb1d388
commit
bd511584e7
@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:spotube/services/logger/logger.dart';
|
||||
@ -49,7 +50,7 @@ final localTracksProvider =
|
||||
userPreferencesProvider.select((s) => s.localLibraryLocation),
|
||||
);
|
||||
|
||||
for (var location in [downloadLocation, ...localLibraryLocations]) {
|
||||
for (final location in [downloadLocation, ...localLibraryLocations]) {
|
||||
if (location.isEmpty) continue;
|
||||
final entities = <FileSystemEntity>[];
|
||||
if (await Directory(location).exists()) {
|
||||
@ -67,7 +68,8 @@ final localTracksProvider =
|
||||
}).map(
|
||||
(file) async {
|
||||
try {
|
||||
final metadata = await MetadataGod.readMetadata(file: file.path);
|
||||
final metadata = await MetadataGod.readMetadata(file: file.path)
|
||||
.timeout(const Duration(seconds: 10));
|
||||
|
||||
final imageFile = File(join(
|
||||
(await getTemporaryDirectory()).path,
|
||||
@ -89,7 +91,7 @@ final localTracksProvider =
|
||||
"art": imageFile.path
|
||||
};
|
||||
} catch (e, stack) {
|
||||
if (e is FfiException) {
|
||||
if (e case FfiException() || TimeoutException()) {
|
||||
return {"file": file};
|
||||
}
|
||||
AppLogger.reportError(e, stack);
|
||||
|
@ -29,7 +29,7 @@ class AudioServices with WidgetsBindingObserver {
|
||||
androidNotificationChannelId:
|
||||
kIsLinux ? 'spotube' : 'com.krtirtho.Spotube',
|
||||
androidNotificationChannelName: 'Spotube',
|
||||
androidNotificationOngoing: true,
|
||||
androidNotificationOngoing: false,
|
||||
androidNotificationIcon: "drawable/ic_launcher_monochrome",
|
||||
androidStopForegroundOnPause: false,
|
||||
androidNotificationChannelDescription: "Spotube Media Controls",
|
||||
|
Loading…
Reference in New Issue
Block a user