Skip to content

Commit

Permalink
fix: SkipGapsRequest requires AuthKey
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Dec 7, 2023
1 parent 1d15379 commit b5a7124
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/models/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ impl<E: Env + 'static> UpdateWithCtx<E> for Player {
Ok(response) => Loadable::Ready(response),
Err(err) => Loadable::Err(err),
};

eq_update(&mut self.skip_gaps, Some(skip_gaps_next))
}
Msg::Internal(Internal::ProfileChanged) => {
Expand Down Expand Up @@ -1076,6 +1076,7 @@ fn skip_gaps_update<E: Env + 'static>(
auth.user
.premium_expire
.filter(|premium_expire| premium_expire > &E::now())
.map(|premium_expire| (premium_expire, auth.key.clone()))
});

let skip_gaps_request_effects = match (
Expand All @@ -1086,7 +1087,7 @@ fn skip_gaps_update<E: Env + 'static>(
library_item,
) {
(
Some(_expires),
Some((_expires, auth_key)),
Some(selected),
Some(video_params),
Some(series_info),
Expand All @@ -1108,6 +1109,7 @@ fn skip_gaps_update<E: Env + 'static>(
};

let skip_gaps_request = SkipGapsRequest {
auth_key,
opensubtitles_hash,
item_id: library_item.id.to_owned(),
series_info: series_info.to_owned(),
Expand Down
2 changes: 2 additions & 0 deletions src/types/api/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ pub struct SeekLogRequest {
#[derive(Clone, PartialEq, Eq, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct SkipGapsRequest {
/// User's Auth Key, this requests requires premium account.
pub auth_key: AuthKey,
/// Opensubtitles hash returned by the server
#[serde(rename = "osId")]
pub opensubtitles_hash: String,
Expand Down

0 comments on commit b5a7124

Please sign in to comment.