[fix] next_series_seasons - Limit size of emit in one run#1828
Merged
[fix] next_series_seasons - Limit size of emit in one run#1828
Conversation
Given a season identifier of S2014 and backfill enabled, it is possible for `next_series_seasons` to emit all the way down to zero. This change prevents it from emitting if `begin` is not set and the group of seasons to review is more than 15, or if `begin` is set and the difference between the latest season to review and `begin` is more than 30. In both cases the user will be required to set or adjust `begin` before any emit will occur.
liiight
reviewed
May 18, 2017
| else: | ||
| latest_season = low_season + 1 | ||
|
|
||
| if (latest_season - low_season > 15 and not series.begin) or (series.begin and |
Member
There was a problem hiding this comment.
Maybe move these values to consts?
| log.error('Series `%s` does not have a begin episode set and continuing this task would result ' 'in more than 15 seasons being emitted. To prevent emitting incorrect seasons, this ' | ||
| 'series will not emit unless the begin episode is set in your series config or by ' | ||
| 'using the CLI subcommand `series begin "%s" <SxxExx>`.', series.name, series.name) | ||
| continue |
Member
There was a problem hiding this comment.
So if season is 2017 the user will get 2005 error messages in the log?
Contributor
Author
There was a problem hiding this comment.
No, this is outside the loop that counts through the seasons. This should only happen once per series.
liiight
reviewed
May 19, 2017
| if isinstance(config, bool): | ||
| config = {} | ||
|
|
||
| DIFF_NO_SERIES_BEGIN = 15 |
Member
There was a problem hiding this comment.
These should ideally go at the beginning of the module, outside if the plugin class. The idea is that constant values like these can be easily viewed when editing the file and kit hidden internally.
Also I'm not too wild about their names but can't think of a better idea...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for changes:
Given a season identifier of S2014 and backfill enabled, it is possible for
next_series_seasonsto emit all the way down to S01 in one run.Detailed changes:
This change prevents it from emitting if
beginis not set and the group of seasons to review is more than 15, or ifbeginis set and the difference between the latest season to review andbeginis more than 30. In both cases the user will be required to set or adjustbeginbefore any emit will occur.Addressed issues: