perf(metadata): avoid SAF copies during quality probes

This commit is contained in:
zarzet
2026-07-28 01:50:41 +07:00
parent 26570792a9
commit 80d9d87870
7 changed files with 186 additions and 3 deletions
+4 -1
View File
@@ -524,7 +524,10 @@ class DownloadHistoryNotifier extends Notifier<DownloadHistoryState> {
lookupItems: _lookupItemsWithUpdates([updated]),
);
await _db.upsert(updated.toJson());
_bumpHistoryRevision();
// Swiping through older tracks can backfill several quality records in a
// short burst. Coalesce their DB-derived Library refreshes just like
// download completion writes instead of rebuilding every view per swipe.
_scheduleIndexBump();
}
Future<void> updateMetadataForItem({
@@ -392,7 +392,7 @@ extension _HistoryStartupMaintenance on DownloadHistoryNotifier {
}
try {
final result = await PlatformBridge.readFileMetadata(filePath);
final result = await PlatformBridge.readDisplayAudioMetadata(filePath);
final error = result['error'];
if (error != null) {
if (_isPermanentProbeError(error.toString())) {