From d077f5aa09de124bc6f62d26938eb68b6bd63b75 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Sun, 21 Apr 2024 21:12:02 +0200 Subject: [PATCH 1/3] add vs code settings --- .gitignore | 1 - .vscode/extensions.json | 7 +++++++ .vscode/settings.json | 20 ++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index f70d6280..ae60ba83 100644 --- a/.gitignore +++ b/.gitignore @@ -25,5 +25,4 @@ ffpapi.1.gz /dist/ /public/ tmp/ -.vscode/ assets/playlist_template.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..f4fb1d4f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "rust-lang.rust-analyzer", + "statiolake.vscode-rustfmt", + "tamasfe.even-better-toml", + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..766d5939 --- /dev/null +++ b/.vscode/settings.json @@ -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" + } +} From 586a5a91e6fa9071470c8e945f5b89ece4856ae7 Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Sun, 21 Apr 2024 21:23:06 +0200 Subject: [PATCH 2/3] catch remote playlist error and get empty playlist --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- lib/src/utils/json_serializer.rs | 10 ++++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 60c69ff6..9739e0ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", diff --git a/Cargo.toml b/Cargo.toml index 3c0f8742..15993ce8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 "] diff --git a/lib/src/utils/json_serializer.rs b/lib/src/utils/json_serializer.rs index a486a7d3..6e620352 100644 --- a/lib/src/utils/json_serializer.rs +++ b/lib/src/utils/json_serializer.rs @@ -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); From 5855eed6915b6eed4db64e0f47249f82a6388e4c Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Sun, 21 Apr 2024 21:23:42 +0200 Subject: [PATCH 3/3] update frontend --- ffplayout-frontend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ffplayout-frontend b/ffplayout-frontend index 56db578d..52411f61 160000 --- a/ffplayout-frontend +++ b/ffplayout-frontend @@ -1 +1 @@ -Subproject commit 56db578d8cf69aee7fc573828016fa728315bf79 +Subproject commit 52411f61ef25a1b11129a77d26d987f44c6ea543