fix: Prevent externalAudioReader from hogging the main thread

This commit is contained in:
le-firehawk 2025-10-04 23:02:12 +09:30
parent 1357c5c062
commit 620fba0a14
12 changed files with 242 additions and 90 deletions

View file

@ -159,7 +159,7 @@ public class ExternalAudioWriter {
if (matches) {
ExternalDownloadMetadataStore.recordSize(metadataKey, localLength);
recordDownload(child, existingFile.getUri());
ExternalAudioReader.refreshCache();
ExternalAudioReader.refreshCacheAsync();
notifyExists(context, fileName);
return;
} else {
@ -209,7 +209,7 @@ public class ExternalAudioWriter {
ExternalDownloadMetadataStore.recordSize(metadataKey, total);
recordDownload(child, targetUri);
notifySuccess(context, fileName, child, targetUri);
ExternalAudioReader.refreshCache();
ExternalAudioReader.refreshCacheAsync();
}
} catch (Exception e) {
if (targetFile != null) {