Skip to content

Conversation

@anikettuli
Copy link

Summary

Fixes #12 - Items are now removed from the continue watching section when the user has watched >= 95% of their duration.

Changes

  • src/types/library/library_item.rs - Added 95% progress threshold to is_in_continue_watching() method

Testing

All 194 existing tests pass.

Fixes Stremio#12 - Items are now removed from continue watching section
when user has watched >= 95% of their duration.
Copilot AI review requested due to automatic review settings January 30, 2026 07:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements the feature requested in issue #12 to hide movies and episodes from the continue watching section once users have watched 95% or more of their duration.

Changes:

  • Added a 95% completion threshold constant to filter items from the continue watching section
  • Modified is_in_continue_watching() method to exclude items with progress >= 95%

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

let recently_removed = self.removed && self.mtime > year_ago;
self.r#type != "other" && (!self.removed || recently_removed)
}
const CONTINUE_WATCHING_COMPLETION_THRESHOLD: f64 = 95.0;
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constant CONTINUE_WATCHING_COMPLETION_THRESHOLD is placed in the middle of the impl block between methods, which is unconventional in Rust. Constants should typically be declared at the top of the impl block before any methods, or moved to the src/constants.rs file where similar thresholds like WATCHED_THRESHOLD_COEF are defined. This would improve code organization and make the constant more discoverable alongside other project-wide constants.

Copilot uses AI. Check for mistakes.
Comment on lines 54 to 59
pub fn is_in_continue_watching(&self) -> bool {
// re-added (!self.removed || temp) check
// makes sure to add only relevant Library Items to the Continue Watching
self.r#type != "other" && (!self.removed || self.temp) && self.state.time_offset > 0
self.r#type != "other"
&& (!self.removed || self.temp)
&& self.state.time_offset > 0
&& self.progress() < Self::CONTINUE_WATCHING_COMPLETION_THRESHOLD
}
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is_in_continue_watching() method lacks a documentation comment explaining its behavior, especially the new 95% completion threshold. Adding a doc comment would help other developers understand when items are filtered from the continue watching section. Consider adding documentation similar to the should_pull_notifications() method above, which clearly lists the conditions that must be met.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop showing items in continue watching section when fixed % of movie has been watched

1 participant