Browse Source

Make sure that Rating support is suppressed completely when disabled.

0.7.x
shypike 11 years ago
parent
commit
543eeae124
  1. 1
      sabnzbd/api.py
  2. 1
      sabnzbd/interface.py
  3. 1
      sabnzbd/nzbstuff.py
  4. 1
      sabnzbd/postproc.py

1
sabnzbd/api.py

@ -283,6 +283,7 @@ def _api_queue_rating(output, value, kwargs):
audio = setting if type == 'audio' and setting != "-" else None
vote = vote_map[setting] if type == 'vote' else None
flag = flag_map[setting] if type == 'flag' else None
if cfg.rating_enable():
Rating.do.update_user_rating(value, video, audio, vote, flag, kwargs.get('detail'))
return report(output)
except:

1
sabnzbd/interface.py

@ -1056,6 +1056,7 @@ class HistoryPage(object):
audio = kwargs.get('audio') if kwargs.get('audio') != "-" else None
flag = flag_map.get(kwargs.get('rating_flag'))
detail = kwargs.get('expired_host') if kwargs.get('expired_host') != '<Host>' else None
if cfg.rating_enable():
Rating.do.update_user_rating(kwargs.get('job'), video, audio, flag, detail)
except:
pass

1
sabnzbd/nzbstuff.py

@ -1310,6 +1310,7 @@ class NzbObject(TryList):
# Determine if rating information (including site identifier so rating can be updated)
# is present in metadata and if so store it
def update_rating(self):
if cfg.rating_enable():
try:
def _get_first_meta(type):
values = self.meta.get('x-oznzb-rating-' + type, None) or self.meta.get('x-rating-' + type, None)

1
sabnzbd/postproc.py

@ -489,6 +489,7 @@ def process_job(nzo):
all_ok = all_ok and not empty
## Update indexer with results
if cfg.rating_enable():
if nzo.encrypted > 0:
Rating.do.update_auto_flag(nzo.nzo_id, Rating.FLAG_ENCRYPTED)
if empty:

Loading…
Cancel
Save