catch remote playlist error and get empty playlist
This commit is contained in:
parent
d077f5aa09
commit
586a5a91e6
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -1217,7 +1217,7 @@ checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984"
|
||||
|
||||
[[package]]
|
||||
name = "ffplayout"
|
||||
version = "0.21.2"
|
||||
version = "0.21.3"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"clap",
|
||||
@ -1239,7 +1239,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ffplayout-api"
|
||||
version = "0.21.2"
|
||||
version = "0.21.3"
|
||||
dependencies = [
|
||||
"actix-files",
|
||||
"actix-multipart",
|
||||
@ -1278,7 +1278,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ffplayout-lib"
|
||||
version = "0.21.2"
|
||||
version = "0.21.3"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"crossbeam-channel",
|
||||
@ -3458,7 +3458,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tests"
|
||||
version = "0.21.2"
|
||||
version = "0.21.3"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"crossbeam-channel",
|
||||
|
@ -4,7 +4,7 @@ default-members = ["ffplayout-api", "ffplayout-engine", "tests"]
|
||||
resolver = "2"
|
||||
|
||||
[workspace.package]
|
||||
version = "0.21.2"
|
||||
version = "0.21.3"
|
||||
license = "GPL-3.0"
|
||||
repository = "https://github.com/ffplayout/ffplayout"
|
||||
authors = ["Jonathan Baecker <jonbae77@gmail.com>"]
|
||||
|
@ -126,8 +126,14 @@ pub fn read_json(
|
||||
let headers = resp.headers().clone();
|
||||
|
||||
if let Ok(body) = resp.text() {
|
||||
let mut playlist: JsonPlaylist =
|
||||
serde_json::from_str(&body).expect("Could't read remote json playlist.");
|
||||
let mut playlist: JsonPlaylist = match serde_json::from_str(&body) {
|
||||
Ok(p) => p,
|
||||
Err(e) => {
|
||||
error!("Could't read remote json playlist. {e:?}");
|
||||
JsonPlaylist::new(date.clone(), start_sec)
|
||||
}
|
||||
};
|
||||
|
||||
playlist.path = Some(current_file);
|
||||
playlist.start_sec = Some(start_sec);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user