Compare commits

...

2 Commits

Author SHA1 Message Date
Philipp Hofer
f4b1ae1b8a Merge branch 'main' of https://git.hofer.link/philipp/oe1-player
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m18s
CI/CD Pipeline / deploy (push) Successful in 1m19s
2025-10-13 11:16:30 +02:00
Philipp Hofer
352b86edad remove temp. data storage (e.g. date), and look directly at data, don't re-download (e.g. on sundays) if url has already been downloaded
Some checks failed
CI/CD Pipeline / deploy (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled
2025-10-13 11:15:25 +02:00

View File

@@ -28,10 +28,10 @@ async fn get_newest_morning_journal() -> Result<(NaiveDate, String), Box<dyn std
if broadcast["title"] == "Ö1 Morgenjournal"
&& let Some(href) = broadcast["href"].as_str()
{
let date = broadcast["broadcastDay"]
.as_str()
.expect("There needs to be a broadcastDay!");
let date = NaiveDate::parse_from_str(date, "%Y%m%d").expect("broadcastDay in https://audioapi.orf.at/oe1/api/json/current/broadcasts not in a valid format");
let date = broadcast["broadcastDay"].as_number().unwrap_or_else(|| {
panic!("There needs to be a broadcastDay! {}", &broadcast)
});
let date = NaiveDate::parse_from_str(&date.to_string(), "%Y%m%d").expect("broadcastDay in https://audioapi.orf.at/oe1/api/json/current/broadcasts not in a valid format");
return Ok((date, href.into()));
}
}