mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-28 23:08:59 +02:00
MainActivity duplicated the whole SAF helper cluster (sanitizeFilename, truncation, ensureDocumentDir, createOrReuseDocumentFile, ...) and both classes synchronized on separate locks, so a foreground SAF write racing a service-worker write into the same tree was never serialized and could produce duplicate documents. One shared home, one lock. normalizeExt adopts the trim-first variant; mimeTypeForExt is the union of all three copies (adds wav/aiff/ogg coverage everywhere).