fix case, when init is short before start time

This commit is contained in:
jb-alvarado 2022-03-11 09:50:11 +01:00
parent 8ba2a67b02
commit 072bb54e98

View File

@ -35,9 +35,9 @@ impl CurrentProgram {
} }
} }
fn check_update(&mut self) { fn check_update(&mut self, seek: bool) {
if self.json_path.is_none() { if self.json_path.is_none() {
let json = read_json(&self.config, false, 0.0); let json = read_json(&self.config, seek, 0.0);
self.json_path = json.current_file; self.json_path = json.current_file;
self.json_mod = json.modified; self.json_mod = json.modified;
@ -153,7 +153,7 @@ impl Iterator for CurrentProgram {
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
if self.init { if self.init {
debug!("Playlist init"); debug!("Playlist init");
self.check_update(); self.check_update(true);
if self.json_path.is_some() { if self.json_path.is_some() {
self.get_init_clip(); self.get_init_clip();
@ -204,7 +204,7 @@ impl Iterator for CurrentProgram {
return Some(self.current_node.clone()); return Some(self.current_node.clone());
} }
if self.index < self.nodes.len() { if self.index < self.nodes.len() {
self.check_update(); self.check_update(false);
self.check_for_next_playlist(); self.check_for_next_playlist();
let mut is_last = false; let mut is_last = false;