From 19bf048fbba6e3a12985a265de96a1254605d3fe Mon Sep 17 00:00:00 2001 From: evilhero Date: Thu, 7 Apr 2016 14:45:36 -0400 Subject: [PATCH] FIX: Blacklisted_Publishers (config.ini entry only) now fixed to limit search/import results --- mylar/__init__.py | 13 ++++--------- mylar/mb.py | 8 ++++---- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/mylar/__init__.py b/mylar/__init__.py index db7fef43..2ee5d59d 100755 --- a/mylar/__init__.py +++ b/mylar/__init__.py @@ -644,11 +644,9 @@ def initialize(): INDIE_PUB = check_setting_str(CFG, 'General', 'indie_pub', '75') BIGGIE_PUB = check_setting_str(CFG, 'General', 'biggie_pub', '55') - flattened_blacklisted_pub = check_setting_str(CFG, 'General', 'blacklisted_publishers', [], log=False) - if len(flattened_blacklisted_pub) == 0 or flattened_blacklisted_pub == 'None': + BLACKLISTED_PUBLISHERS = check_setting_str(CFG, 'General', 'blacklisted_publishers', [], log=False) + if len(BLACKLISTED_PUBLISHERS) == 0 or BLACKLISTED_PUBLISHERS == 'None': BLACKLISTED_PUBLISHERS = None - else: - BLACKLISTED_PUBLISHERS = list(itertools.izip(*[itertools.islice(flattened_blacklisted_pub, i, None, 1) for i in range(1)])) ENABLE_RSS = bool(check_setting_int(CFG, 'General', 'enable_rss', 1)) RSS_CHECKINTERVAL = check_setting_str(CFG, 'General', 'rss_checkinterval', '20') @@ -1286,11 +1284,8 @@ def config_write(): flattened_blacklisted_pub = None else: flattened_blacklisted_pub = [] - for bpub in BLACKLISTED_PUBLISHERS: - #for key, value in pro.items(): - for item in bpub: - flattened_blacklisted_pub.append(item) - #flattened_providers.append(str(value)) + for item in BLACKLISTED_PUBLISHERS: + flattened_blacklisted_pub.append(item) new_config['General']['blacklisted_publishers'] = flattened_blacklisted_pub new_config['General']['imp_move'] = int(IMP_MOVE) new_config['General']['imp_rename'] = int(IMP_RENAME) diff --git a/mylar/mb.py b/mylar/mb.py index f8fee07a..b4b07d11 100755 --- a/mylar/mb.py +++ b/mylar/mb.py @@ -303,12 +303,12 @@ def findComic(name, mode, issue, limityear=None, explicit=None, type=None): xmlpub = "Unknown" else: xmlpub = "Unknown" - logger.info('publisher: ' + xmlpub) + #ignore specific publishers on a global scale here. - #if mylar.BLACKLISTED_PUBLISHERS in xmlpub.lower(): #any([x for x in mylar.BLACKLISTED_PUBLISHERS if x.lower() == xmlpub.lower()]): + if mylar.BLACKLISTED_PUBLISHERS is not None and any([x for x in mylar.BLACKLISTED_PUBLISHERS if x.lower() == xmlpub.lower()]): # #'panini' in xmlpub.lower() or 'deagostini' in xmlpub.lower() or 'Editorial Televisa' in xmlpub.lower(): - # logger.fdebug('Blacklisted publisher [' + xmlpub + ']. Ignoring this result.') - # continue + logger.fdebug('Blacklisted publisher [' + xmlpub + ']. Ignoring this result.') + continue try: xmldesc = result.getElementsByTagName('description')[0].firstChild.wholeText