Skip to content

Commit

Permalink
Merge branch 'feat/get-skip-gaps' into feat/player-intro-outro
Browse files Browse the repository at this point in the history
  • Loading branch information
elpiel committed Jan 3, 2024
2 parents e005166 + a225c2e commit 418cdf8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
17 changes: 17 additions & 0 deletions src/deep_links/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,3 +565,20 @@ impl From<&String> for SearchHistoryItemDeepLinks {
}
}
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LocalSearchItemDeepLinks {
pub search: String,
}

impl From<&String> for LocalSearchItemDeepLinks {
fn from(query: &String) -> Self {
LocalSearchItemDeepLinks {
search: format!(
"stremio:///search?query={}",
utf8_percent_encode(query, URI_COMPONENT_ENCODE_SET),
),
}
}
}
4 changes: 2 additions & 2 deletions src/models/ctx/update_notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn update_notifications<E: Env + 'static>(
let (reason, should_make_request) = match notifications.last_updated {
Some(last_updated) if last_updated + *REQUEST_LAST_VIDEOS_EVERY <= E::now() => (
format!(
"`true` since {last_updated} + {hours} <= {now}",
"`true` since {last_updated} + {hours} hours <= {now}",
hours = REQUEST_LAST_VIDEOS_EVERY.num_hours(),
now = E::now()
),
Expand All @@ -52,7 +52,7 @@ pub fn update_notifications<E: Env + 'static>(
None => ("`true` since last updated is `None`".to_string(), true),
Some(last_updated) => (
format!(
"`false` since {last_updated} + {hours} > {now}",
"`false` since {last_updated} + {hours} hours > {now}",
hours = REQUEST_LAST_VIDEOS_EVERY.num_hours(),
now = E::now()
),
Expand Down
6 changes: 4 additions & 2 deletions src/models/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ impl<E: Env + 'static> UpdateWithCtx<E> for Player {
let watched_effects =
watched_update(&mut self.watched, &self.meta_item, &self.library_item);

let intro_outro_effects = intro_outro_update::<E>(
let skip_gaps_effects = eq_update(&mut self.skip_gaps, None);
let intro_outro_update_effects = intro_outro_update::<E>(
&mut self.intro_outro,
&ctx.profile,
self.selected.as_ref(),
Expand Down Expand Up @@ -275,7 +276,8 @@ impl<E: Env + 'static> UpdateWithCtx<E> for Player {
.join(series_info_effects)
.join(library_item_effects)
.join(watched_effects)
.join(intro_outro_effects)
.join(skip_gaps_effects)
.join(intro_outro_update_effects)
.join(notification_effects)
}
Msg::Action(Action::Unload) => {
Expand Down

0 comments on commit 418cdf8

Please sign in to comment.