refactor(analysis_cache): split SQLite store from decode/EBU compute

Convert analysis_cache.rs (901 LOC) into a module directory:
- store.rs (408 LOC): AnalysisCache + types + SQLite plumbing
  (DB path, pragmas, schema migration, all DML, track-id variant lookup)
- compute.rs (498 LOC): Symphonia decode + EBU R.128 + waveform binning
  (seed_from_bytes_execute, analyze_loudness_and_waveform, decode_scan_pcm,
  byte-envelope fallback, recommended_gain_for_target)
- mod.rs: re-exports the unchanged public surface

External callers (lib.rs, audio/helpers, audio/commands, cache/offline,
app_api/analysis) keep importing from `crate::analysis_cache::*` — same
names, same signatures, behaviour unchanged. cargo check clean.
This commit is contained in:
Psychotoxical
2026-05-08 11:47:27 +02:00
parent 480e32ba04
commit 66cbf25469
3 changed files with 415 additions and 405 deletions
+5
View File
@@ -0,0 +1,5 @@
mod compute;
mod store;
pub use compute::{recommended_gain_for_target, seed_from_bytes_execute, SeedFromBytesOutcome};
pub use store::{AnalysisCache, TrackKey};