Compare commits
2 Commits
a69a0f5b41
...
f4b1ae1b8a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4b1ae1b8a | ||
|
|
352b86edad |
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user