Merge branch 'hotfix/0.13.10'

This commit is contained in:
JackDandy 2018-01-08 17:17:57 +00:00
commit b57660a681
3 changed files with 1588 additions and 23 deletions

View file

@ -1,4 +1,9 @@
### 0.13.9 (2018-01-02 15:45:00 UTC)
### 0.13.10 (2018-01-08 17:20:00 UTC)
* Fix "Upgrade once" for wanted qualities
### 0.13.9 (2018-01-02 15:45:00 UTC)
* Fix marking episode as to upgrade

View file

@ -388,24 +388,24 @@ class wantedQualities(dict):
def _generate_wantedlist(self, qualities):
initial_qualities, upgrade_qualities = Quality.splitQuality(qualities)
max_initial_quality = max(initial_qualities or [Quality.NONE])
min_upgrade_quality = min(upgrade_qualities or [1 << 16])
self[qualities] = {0: {self.bothlists: False, self.wantedlist: initial_qualities, self.upgradelist: False}}
for q in Quality.qualityStrings:
if 0 >= q:
continue
wanted = [i for i in upgrade_qualities if q < i]
if 0 < q:
self[qualities][q] = {self.wantedlist: [i for i in upgrade_qualities if q < i], self.upgradelist: False}
if q not in upgrade_qualities and q in initial_qualities:
# quality is only in initial_qualities
self[qualities][q] = {self.bothlists: False, self.wantedlist: wanted, self.upgradelist: False}
w = {self.bothlists: False}
elif q in upgrade_qualities and q in initial_qualities:
# quality is in initial_qualities and upgrade_qualities
self[qualities][q] = {self.bothlists: True, self.wantedlist: wanted, self.upgradelist: True}
w = {self.bothlists: True, self.upgradelist: True}
elif q in upgrade_qualities:
# quality is only in upgrade_qualities
self[qualities][q] = {self.bothlists: False, self.wantedlist: wanted, self.upgradelist: True}
w = {self.bothlists: False, self.upgradelist: True}
else:
# quality is not in any selected quality for the show
self[qualities][q] = {self.bothlists: False, self.wantedlist: wanted,
self.upgradelist: (q >= max_initial_quality) and any(upgrade_qualities)}
# quality is not in any selected quality for the show (known as "unwanted")
w = {self.bothlists: max_initial_quality >= q >= min_upgrade_quality}
self[qualities][q].update(w)
def __getitem__(self, k):
if k not in self:
@ -418,7 +418,8 @@ class wantedQualities(dict):
return super(wantedQualities, self).get(k, *args, **kwargs)
def get_wantedlist(self, qualities, upgradeonce, quality, status, unaired=False, manual=False):
if not manual and status in [ARCHIVED, IGNORED, SKIPPED] + ([UNAIRED], [])[unaired]:
if not manual:
if status in [ARCHIVED, IGNORED, SKIPPED] + ([UNAIRED], [])[unaired]:
return []
if upgradeonce:
if status == SNATCHED_BEST or \

File diff suppressed because it is too large Load diff