feat: propagate download cancel to extension HTTP requests and fix SAF filename extension mismatch

- Bind cancel context to all extension HTTP calls (fetch, httpGet, httpPost,
  httpRequest, fileDownload, authExchangeCodeWithPKCE) so in-flight requests
  are aborted when user cancels a download
- Make initDownloadCancel idempotent: return existing context if entry already
  exists and preserve pre-cancelled state
- Force SAF output filename to match actual file extension when extension
  returns a different format than requested (e.g. FLAC requested but M4A produced)
- Map ALAC/AAC quality to .m4a instead of falling through to default .flac
This commit is contained in:
zarzet
2026-04-13 22:20:17 +07:00
parent 7405855e01
commit dbba4d6630
10 changed files with 141 additions and 3 deletions
@@ -2378,6 +2378,7 @@ class DownloadQueueNotifier extends Notifier<DownloadQueueState> {
return '.m4a';
}
final q = quality.toLowerCase();
if (q == 'alac' || q.startsWith('aac')) return '.m4a';
if (q.startsWith('opus')) return '.opus';
if (q.startsWith('mp3')) return '.mp3';
return '.flac';