Skip to content

Commit

Permalink
fix: pull notifications conditions refinement
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Aug 11, 2023
1 parent 4bc8c35 commit edac44c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/types/library/library_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,20 @@ impl LibraryItem {
pub fn is_in_continue_watching(&self) -> bool {
self.r#type != "other" && (!self.removed || self.temp) && self.state.time_offset > 0
}

/// Pulling notifications relies on a few key things:
///
/// - LibraryItem should not be "other" or "movie", i.e. if you have "series" it will pull notifications
/// - `LibraryItem.behavior_hints.default_video_id` should be `None`
/// - The LibraryItem should not have been removed from the Library
/// - The LibraryItem should not be temporary but in your LibraryItem
pub fn should_pull_notifications(&self) -> bool {
!self.state.no_notif
&& self.r#type != "other"
&& self.r#type != "movie"
&& self.behavior_hints.default_video_id.is_none()
&& (!self.removed || self.temp)
&& !self.removed
&& !self.temp
}
}

Expand Down

0 comments on commit edac44c

Please sign in to comment.