soulsync/core/repair_jobs
BoulderBadgeDad 4af7600fd5 lossy copy: support all lossless formats, not just FLAC (#941)
radoslav-orlov: "create lossy copies of lossless tracks" only recognized FLAC, even though ALAC/
WAV/AIFF/DSD are now quality-profile formats. the FLAC knowledge was hardcoded in 3 separate
places (the import path, the Lossy Converter scan, and the fix executor) — exactly how a format
gets added in one spot but not another.

kettui-style fix — one canonical seam both sites route through, instead of 3 more string edits:

- new core/quality/lossless.py: is_lossless_format / is_lossless_audio_path (pure; injects a
  codec probe for the ambiguous .m4a/.mp4 — ALAC vs AAC — so the decision stays testable with no
  I/O), LOSSLESS_FORMATS (single source of truth, derived-consistent with model.tier_score), and
  the lossy_output_would_overwrite_source safety invariant.
- create_lossy_copy + the Lossy Converter scan + repair_worker._fix_missing_lossy_copy all route
  through it. SQL pre-filters by candidate extensions, then each file is confirmed (probing .m4a).
- SAFETY: a lossy copy must never be written over its own source — an .m4a ALAC source + AAC
  target lands on the same .m4a path, and ffmpeg runs with -y. all three sites now bail on the
  overwrite case BEFORE ffmpeg (the existing delete-original guard was too late — the source was
  already clobbered). dropped a vestigial mutagen FLAC import; updated FLAC-only UI strings.

19 tests: full seam coverage (formats, the .m4a ALAC/AAC probe branch, candidate extensions, the
overwrite guard), a tier-model consistency test that fails if the lossless set drifts, and import-
site wiring tests — WAV now converts (was rejected), and the .m4a-ALAC+AAC overwrite case proves
ffmpeg NEVER runs. 286 quality/import/repair tests green, ruff clean.
2026-06-28 12:13:05 -07:00
..
__init__.py tools: add Preview Clip Cleanup repair job (detect ~30s previews, re-fetch full track) 2026-06-27 16:07:41 -07:00
acoustid_scanner.py downloads: stop AcoustID scan duplicating history rows / leaving verified tracks 'unverified' (#934) 2026-06-27 09:52:39 -07:00
album_completeness.py album completeness: fix excluded-sibling missing list + O(N) grouping (follow-up to #936) 2026-06-27 18:18:50 -07:00
album_tag_consistency.py Surface silent exceptions in workers + repair jobs — ~30 sites 2026-05-07 10:27:24 -07:00
base.py Repair settings: dropdown for fixed-choice settings (canonical source_selection) 2026-06-02 15:33:13 -07:00
cache_evictor.py Metadata cache: hard LRU row cap to stop unbounded growth (7.6GB incident) 2026-05-30 23:22:05 -07:00
canonical_version_resolve.py Canonical: fix ruff lint (B023 loop-bound lambda, S110 bare except-pass) 2026-06-02 15:42:14 -07:00
dead_file_cleaner.py Dead File Cleaner: don't flag a whole library when paths just aren't reachable (#828) 2026-06-09 13:12:50 -07:00
discography_backfill.py Surface silent exceptions in workers + repair jobs — ~30 sites 2026-05-07 10:27:24 -07:00
duplicate_detector.py Fix: maintenance findings badge inflated when scan dedup-skipped 2026-05-04 08:55:13 -07:00
empty_folder_cleaner.py #912: Empty Folder Cleaner reads its opt-in from the right config key 2026-06-23 11:26:00 -07:00
expired_download_cleaner.py Expired Cleaner: set auto_fix=True so the Dry Run badge shows (was mislabeled 'Scan Only') 2026-06-07 22:24:59 -07:00
fake_lossless_detector.py Fix: maintenance findings badge inflated when scan dedup-skipped 2026-05-04 08:55:13 -07:00
library_reorganize.py #862: Library Reorganize falls back to tag-mode when an album has no source ID (media-server libs now actually reorganize) 2026-06-12 20:05:50 -07:00
library_retag.py Lyrics retag: fetch query from a read-only lyrics_meta, never db_data (no tag pollution) 2026-06-07 19:42:30 -07:00
live_commentary_cleaner.py Fix: maintenance findings badge inflated when scan dedup-skipped 2026-05-04 08:55:13 -07:00
lossy_converter.py lossy copy: support all lossless formats, not just FLAC (#941) 2026-06-28 12:13:05 -07:00
mbid_mismatch_detector.py Surface silent exceptions in workers + repair jobs — ~30 sites 2026-05-07 10:27:24 -07:00
metadata_gap_filler.py Fix: maintenance findings badge inflated when scan dedup-skipped 2026-05-04 08:55:13 -07:00
missing_cover_art.py Cover Art Filler: scan falls back to the raw file path when mapping fails (Sokhi #fix) 2026-06-08 17:32:38 -07:00
missing_lyrics.py Lyrics Filler: convert track duration ms→s for LRClib (exact-match was silently defeated) 2026-06-07 19:45:10 -07:00
orphan_file_detector.py Orphan detector: hard-bail on a mass-orphan flood instead of warn-only 2026-06-12 08:15:23 -07:00
quality_upgrade.py refactor(quality-upgrade): remove legacy hardcoded rank constants and dead functions 2026-06-24 16:02:30 +02:00
quality_upgrade_scanner.py fix(repair-jobs): boolean settings saved as string 'true'/'false' by UI dropdown 2026-06-24 15:59:25 +02:00
relocate.py CI: silence S110 on three intentional best-effort swallows (unblocks dev build) 2026-06-11 16:00:07 -07:00
replaygain_filler.py #437: add ReplayGain Filler library-maintenance job 2026-06-11 18:41:12 -07:00
short_preview_track.py preview-clip job: enable select-all/fix-all + give the re-wishlist proper album art 2026-06-27 17:10:07 -07:00
single_album_dedup.py Fix: maintenance findings badge inflated when scan dedup-skipped 2026-05-04 08:55:13 -07:00
track_number_repair.py Canonical album version — Stage 4: Track Number Repair prefers canonical (read) 2026-06-02 11:47:42 -07:00
unknown_artist_fixer.py fix(repair): rewire Unknown Artist Fixer deferred imports (#646) 2026-05-19 22:09:15 -07:00