artifacts: rewrite the artifacts model to be source agnostic for now

This commit is contained in:
2026-06-09 22:00:37 +02:00
parent 44afe5a713
commit 2fe1cc3d5c
8 changed files with 234 additions and 73 deletions
+10 -7
View File
@@ -253,7 +253,7 @@ impl App {
let status_line = Line::from_iter([
Span::from(format!("Episode {}", self.scene.direction.episode_number)).style(ratatui::style::Color::LightBlue),
Span::from(" | ").style(ratatui::style::Color::DarkGray),
Span::from(format!("{} tracks", self.scene.direction.current_playlist.len())).style(ratatui::style::Color::LightBlue),
Span::from(format!("{} tracks", self.scene.scenery().current_playlist.len())).style(ratatui::style::Color::LightBlue),
Span::from(" | ").style(ratatui::style::Color::DarkGray),
Span::from(format!("Time Remaining: {}", formatted_time)).style(time_style),
Span::from(" | ").style(ratatui::style::Color::DarkGray),
@@ -539,12 +539,15 @@ async fn main() {
let mut terminal: Terminal<CrosstermBackend<std::io::Stdout>> = ratatui::init();
let saved_session = if let Ok(save_data) = std::fs::read_to_string("save.json") {
if let Ok(ret) = serde_json::from_str(&save_data) {
log::info!("Loaded session from save.json");
ret
} else {
log::warn!("Could not load saved session!");
SaveData::default()
match serde_json::from_str(&save_data) {
Ok(ret) => {
log::info!("Loaded session from save.json");
ret
},
Err(err) => {
log::error!("Could not load saved session! {:?}", err);
SaveData::default()
}
}
} else {
log::info!("Creating new session in save.json");