Merge pull request #614 from jb-alvarado/master

catch remote playlist error and get empty playlist
This commit is contained in:
jb-alvarado 2024-04-21 19:39:24 +00:00 committed by GitHub
commit a55408543e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 41 additions and 9 deletions

1
.gitignore vendored
View File

@ -25,5 +25,4 @@ ffpapi.1.gz
/dist/
/public/
tmp/
.vscode/
assets/playlist_template.json

7
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"recommendations": [
"rust-lang.rust-analyzer",
"statiolake.vscode-rustfmt",
"tamasfe.even-better-toml",
]
}

20
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,20 @@
{
"rust-analyzer.cargo.target": null,
"rust-analyzer.checkOnSave": true,
"rust-analyzer.cargo.buildScripts.overrideCommand": null,
"rust-analyzer.rustfmt.overrideCommand": null,
"rust-analyzer.inlayHints.chainingHints.enable": false,
"rust-analyzer.inlayHints.parameterHints.enable": false,
"rust-analyzer.inlayHints.typeHints.enable": false,
"rust-analyzer.diagnostics.disabled": ["unresolved-proc-macro"],
"[dockercompose]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[rust]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "statiolake.vscode-rustfmt"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

8
Cargo.lock generated
View File

@ -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",

View File

@ -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>"]

@ -1 +1 @@
Subproject commit 56db578d8cf69aee7fc573828016fa728315bf79
Subproject commit 52411f61ef25a1b11129a77d26d987f44c6ea543

View File

@ -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);