mini-player: wip

This commit is contained in:
Agahnim 2026-03-19 19:17:53 +01:00
parent db3c7657a3
commit 4611980c23
Signed by: Agahnim
SSH key fingerprint: SHA256:Zj65PJnE0dRYye8Ltk/qDglynyXUxJngQ9qqx/VI+b4
13 changed files with 217 additions and 3 deletions

21
src/state.rs Normal file
View file

@ -0,0 +1,21 @@
pub struct AppState {
mp_tracks: Vec<Track>,
p_tracks: Vec<Track>,
}
impl AppState {
async fn try_new() -> Self {
Self {
mp_tracks: serde_json::from_str(
&std::fs::read_to_string("content/mp-tracks.json")
.expect("mp-tracks.json non trouvé"),
)
.expect("JSON invalide"),
p_tracks: serde_json::from_str(
&std::fs::read_to_string("content/p-tracks.json")
.expect("p-tracks.json non trouvé"),
)
.expect("JSON invalide"),
}
}
}