catch empty program list in playlist

https://github.com/ffplayout/ffplayout-frontend/issues/101
This commit is contained in:
jb-alvarado 2022-12-19 12:39:34 +01:00
parent 1491f46e3d
commit 850a48ed43

View File

@ -203,9 +203,15 @@ pub fn read_json(
Ok(p) => p,
Err(e) => {
error!("Playlist file not readable! {e}");
JsonPlaylist::new(date, start_sec)
JsonPlaylist::new(date.clone(), start_sec)
}
};
// catch empty program list
if playlist.program.is_empty() {
playlist = JsonPlaylist::new(date, start_sec)
}
playlist.modified = modified_time(&current_file);
let list_clone = playlist.clone();