mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 00:43:37 +00:00
Merge branch 'hotfix/0.13.10'
This commit is contained in:
commit
b57660a681
3 changed files with 1588 additions and 23 deletions
|
@ -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
|
* Fix marking episode as to upgrade
|
||||||
|
|
||||||
|
|
|
@ -388,24 +388,24 @@ class wantedQualities(dict):
|
||||||
def _generate_wantedlist(self, qualities):
|
def _generate_wantedlist(self, qualities):
|
||||||
initial_qualities, upgrade_qualities = Quality.splitQuality(qualities)
|
initial_qualities, upgrade_qualities = Quality.splitQuality(qualities)
|
||||||
max_initial_quality = max(initial_qualities or [Quality.NONE])
|
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}}
|
self[qualities] = {0: {self.bothlists: False, self.wantedlist: initial_qualities, self.upgradelist: False}}
|
||||||
for q in Quality.qualityStrings:
|
for q in Quality.qualityStrings:
|
||||||
if 0 >= q:
|
if 0 < q:
|
||||||
continue
|
self[qualities][q] = {self.wantedlist: [i for i in upgrade_qualities if q < i], self.upgradelist: False}
|
||||||
wanted = [i for i in upgrade_qualities if q < i]
|
if q not in upgrade_qualities and q in initial_qualities:
|
||||||
if q not in upgrade_qualities and q in initial_qualities:
|
# quality is only in initial_qualities
|
||||||
# quality is only in initial_qualities
|
w = {self.bothlists: False}
|
||||||
self[qualities][q] = {self.bothlists: False, self.wantedlist: wanted, self.upgradelist: False}
|
elif q in upgrade_qualities and q in initial_qualities:
|
||||||
elif q in upgrade_qualities and q in initial_qualities:
|
# quality is in initial_qualities and upgrade_qualities
|
||||||
# quality is in initial_qualities and upgrade_qualities
|
w = {self.bothlists: True, self.upgradelist: True}
|
||||||
self[qualities][q] = {self.bothlists: True, self.wantedlist: wanted, self.upgradelist: True}
|
elif q in upgrade_qualities:
|
||||||
elif q in upgrade_qualities:
|
# quality is only in upgrade_qualities
|
||||||
# quality is only in upgrade_qualities
|
w = {self.bothlists: False, self.upgradelist: True}
|
||||||
self[qualities][q] = {self.bothlists: False, self.wantedlist: wanted, self.upgradelist: True}
|
else:
|
||||||
else:
|
# quality is not in any selected quality for the show (known as "unwanted")
|
||||||
# quality is not in any selected quality for the show
|
w = {self.bothlists: max_initial_quality >= q >= min_upgrade_quality}
|
||||||
self[qualities][q] = {self.bothlists: False, self.wantedlist: wanted,
|
self[qualities][q].update(w)
|
||||||
self.upgradelist: (q >= max_initial_quality) and any(upgrade_qualities)}
|
|
||||||
|
|
||||||
def __getitem__(self, k):
|
def __getitem__(self, k):
|
||||||
if k not in self:
|
if k not in self:
|
||||||
|
@ -418,13 +418,14 @@ class wantedQualities(dict):
|
||||||
return super(wantedQualities, self).get(k, *args, **kwargs)
|
return super(wantedQualities, self).get(k, *args, **kwargs)
|
||||||
|
|
||||||
def get_wantedlist(self, qualities, upgradeonce, quality, status, unaired=False, manual=False):
|
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:
|
||||||
return []
|
if status in [ARCHIVED, IGNORED, SKIPPED] + ([UNAIRED], [])[unaired]:
|
||||||
if upgradeonce:
|
|
||||||
if status == SNATCHED_BEST or \
|
|
||||||
(not self[qualities][quality][self.bothlists] and self[qualities][quality][self.upgradelist] and
|
|
||||||
status in (DOWNLOADED, SNATCHED, SNATCHED_BEST, SNATCHED_PROPER)):
|
|
||||||
return []
|
return []
|
||||||
|
if upgradeonce:
|
||||||
|
if status == SNATCHED_BEST or \
|
||||||
|
(not self[qualities][quality][self.bothlists] and self[qualities][quality][self.upgradelist] and
|
||||||
|
status in (DOWNLOADED, SNATCHED, SNATCHED_BEST, SNATCHED_PROPER)):
|
||||||
|
return []
|
||||||
return self[qualities][quality][self.wantedlist]
|
return self[qualities][quality][self.wantedlist]
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue