mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-09-30 13:19:44 +02:00
fix(library): preserve indexed tracks when a full scan is incomplete
This commit is contained in:
1 parent
4c2c356763
commit
e3bec31b36
6 files changed
+86
-11
No files matched your search
@@ -802,7 +802,7 @@ class LocalLibraryNotifier extends Notifier<LocalLibraryState> {
|
||||
}
|
||||
}
|
||||
|
||||
if (_scanCancelRequested) {
|
||||
if (_scanCancelRequested || result['cancelled'] == true) {
|
||||
state = state.copyWith(
|
||||
isScanning: false,
|
||||
scanIsFinalizing: false,
|
||||
|
||||
@@ -2328,6 +2328,18 @@ class PlatformBridge {
|
||||
if (result['cancelled'] == true) {
|
||||
throw FormatException('$method returned a cancelled partial scan');
|
||||
}
|
||||
final errors = result['error_count'];
|
||||
if (errors is! num ||
|
||||
!errors.isFinite ||
|
||||
errors < 0 ||
|
||||
errors != errors.toInt()) {
|
||||
throw FormatException('$method returned an invalid error count');
|
||||
}
|
||||
if (errors > 0) {
|
||||
throw FormatException(
|
||||
'Library scan could not read $errors files; the existing Library was kept',
|
||||
);
|
||||
}
|
||||
final pathValue = result['path'];
|
||||
final countValue = result['count'];
|
||||
if (pathValue is! String || pathValue.trim().isEmpty) {
|
||||
|
||||
Reference in new issue
Block a user