-
Notifications
You must be signed in to change notification settings - Fork 4
fix: ensure all wanted episodes are monitored #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/sonarr.rs
Outdated
if !season_episodes.is_empty() { | ||
self.monitor_episodes(&season_episodes).await?; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make it conditional? as far as I understand, it is only ever necessary if season.monitored
was true
.
or alternatively, replace the block above with something like
// Make sure to toggle the season so all episodes are monitored
if season.monitored {
season.monitored = false;
self.put_series(&series).await?;
}
season.monitored = true;
series.monitored = true;
self.put_series(&series).await?;
I'm okay with both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! The episodes are now only monitored explicitly if the season was already monitored.
ty for your contribution! good catch |
@p-hueber would you mind lending me hand with the failing tests? I can't seem to get them working. I added a mock for the episode monitor but it's now failing with:
I honestly have no idea how to fix this :( |
sure! you are facing problems because the existing mocks are expected to be called exactly once. but after your change, it gets the episodes twice. adding another mock does not help, because the pattern of the first one still matches. episodes_mock.assert_hits_async(2).await; you can check what's getting hit with |
Thank you! That did the trick :D |
Hi,
This PR ensures that all episodes within a season are monitored, before starting the season search.
Otherwise sonarr wont actually download missing episodes, if a season itself is monitored but not all episodes within that season.