feat(album): replace selection sharing with metadata re-enrichment

This commit is contained in:
zarzet committed 2026-09-30 23:51:54 +07:00
1 parent ce13e29b71
commit eed56d4cbb
3 files changed
+292 -47

No files matched your search

+11 -6
View File
@@ -145,6 +145,7 @@ Future<void> reEnrichLocalTracks(
required Future<void> Function() onSelectionHide,
required VoidCallback onSelectionRestore,
required VoidCallback onComplete,
Future<void> Function()? refreshLibrary,
}) async {
if (selected.isEmpty) return;
// Capture a stable route context before a caller removes its overlay.
@@ -243,14 +244,18 @@ Future<void> reEnrichLocalTracks(
if (!context.mounted || !isActive()) return;
if (!cancelled) BatchProgressDialog.dismiss(context);
try {
if (!ref.read(localLibraryProvider).isScanning) {
await ref.read(localLibraryProvider.notifier).scanAllSources();
} else {
if (refreshLibrary != null) {
await refreshLibrary();
} else {
try {
if (!ref.read(localLibraryProvider).isScanning) {
await ref.read(localLibraryProvider.notifier).scanAllSources();
} else {
await ref.read(localLibraryProvider.notifier).reloadFromStorage();
}
} catch (_) {
await ref.read(localLibraryProvider.notifier).reloadFromStorage();
}
} catch (_) {
await ref.read(localLibraryProvider.notifier).reloadFromStorage();
}
if (!context.mounted || !isActive()) return;