[fix] next_series_seasons - Use latest download for rerun entry generation#1829
Merged
[fix] next_series_seasons - Use latest download for rerun entry generation#1829
Conversation
…ation Given begin episode of S2014E01, S2017 downloaded in history, and backfill enabled, `next_series_seasons` will emit S2014, S2015, S2016, and S2018. If those are accepted and it’s allowed to rerun, it will then look for S2015, S2016, S2018, and S2019, because when each of the previous seasons was accepted, a rerun entry was created for the season immediately after the accepted season regardless of whether that “next” season was also accepted in that run. This change uses the latest download to determine the next season to search.
liiight
requested changes
May 19, 2017
| log.debug('%s %s was accepted, rerunning to look for next season.', entry['series_name'], | ||
| entry['series_id']) | ||
| self.rerun_entries.append(self.search_entry(series, entry['series_season'] + 1, task)) | ||
| if not [entry for entry in self.rerun_entries if entry.get('series_season') == latest.season + 1]: |
Member
There was a problem hiding this comment.
I'd change this to use the any builtin instead of list comprehension since it's way more optimized for this type of check (will return True immediately when found and not iterate over the whole iterator)
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:
Fixes a bug with erroneously-generated rerun entries. I realize it's small - I submitted it as a PR to ensure this is the FlexGet way to make sure there's no duplicate entry in
self.rerun_entries.Detailed changes:
Given begin episode of S2014E01, S2017 downloaded in history, and backfill enabled,
next_series_seasonswill emit S2014, S2015, S2016, and S2018.If those are accepted and it’s allowed to rerun, it will then look for S2015, S2016, S2018, and S2019, because when each of the previous seasons was accepted, a rerun entry was created for the season immediately after the accepted season regardless of whether that “next” season was also accepted in that run. This is further compounded by the fact that rerun entries are generated without the normal review process in the
latest_season->low_seasonloop and are assumed to be correct.In other words:
After this change:
This change uses the latest downloaded season instead to determine the next season to search.