fix(library): preserve indexed tracks when a full scan is incomplete

This commit is contained in:
zarzet committed 2026-09-28 12:13:17 +07:00
1 parent 4c2c356763
commit e3bec31b36
6 files changed
+86 -11

No files matched your search

+12
View File
@@ -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) {