Files
SpotiFLAC-Mobile/android/app
zarzet e80ae1b1da refactor(android): share the SAF scan percent and CUE helpers
The two SAF scans repeated the same progress arithmetic and CUE steps.
Only the runs that are identical are shared:

- safScanProgressPct(done, total) is the Int/Int to Double * 100.0
  expression all six percent sites used. The incremental scan keeps its
  zero-total guard (100.0), the full scan's call sites keep relying on a
  non-zero total as before.
- reportScanned() replaces the two identical scanned/error/percent
  updates in scanSafTree. The CUE-referenced audio skip keeps its own
  update, which never set errorCount.
- reportProcessed() moves above the changed-CUE loop, whose inline copy
  of its body it now replaces.
- resolveCueSheetAudio() covers the FILE line extraction plus sibling
  lookup that both changed-CUE loops and the unchanged-CUE loop ran.
- scanSafCueTracks() covers the audio name, timestamp, cover key and
  scanCueFromUri steps. The scans fall back to different timestamps
  when the audio's own cannot be read, so the fallback is a lambda and
  still runs only on that failure.

Cancellation checks, checkpoint writes, flushes, the copy/delete of the
temporary CUE file and every counter update stay in place and order;
progress values and the scan output are unchanged.
2026-10-19 05:16:33 +07:00
..