Merge branch 'master' into develop

This commit is contained in:
JackDandy 2018-09-26 18:33:09 +01:00
commit 2e2f5ea83b
4 changed files with 22 additions and 13 deletions

View file

@ -31,6 +31,13 @@
* Change remove deprecated files
### 0.17.7 (2018-09-26 18:30:00 UTC)
* Fix conflicting chars search with RarBG torrent provider
* Change improve Zooqle search
* Fix saving an nzb and a couple of notifs settings as disabled whose defaults were enabled
### 0.17.6 (2018-09-22 09:45:00 UTC)
* Fix propers search for Xspeeds torrent provider

View file

@ -1725,7 +1725,7 @@ def save_config():
new_config['General']['require_words'] = REQUIRE_WORDS
new_config['General']['calendar_unprotected'] = int(CALENDAR_UNPROTECTED)
for src in [x for x in providers.sortedProviderList() if GenericProvider.TORRENT == x.providerType]:
for src in filter(lambda px: GenericProvider.TORRENT == px.providerType, providers.sortedProviderList()):
src_id = src.get_id()
src_id_uc = src_id.upper()
new_config[src_id_uc] = {}
@ -1763,22 +1763,22 @@ def save_config():
if not new_config[src_id_uc]:
del new_config[src_id_uc]
for src in [x for x in providers.sortedProviderList() if GenericProvider.NZB == x.providerType]:
for src in filter(lambda px: GenericProvider.NZB == px.providerType, providers.sortedProviderList()):
src_id = src.get_id()
src_id_uc = src.get_id().upper()
new_config[src_id_uc] = {}
if int(src.enabled):
new_config[src_id_uc][src_id] = int(src.enabled)
for attr in [x for x in ['api_key', 'username', 'search_mode'] if getattr(src, x, None)]:
for attr in filter(lambda a: None is not getattr(src, a, None), ('api_key', 'username', 'search_mode')):
if 'search_mode' != attr or 'eponly' != getattr(src, attr):
new_config[src_id_uc]['%s_%s' % (src_id, attr)] = getattr(src, attr)
for attr in [x for x in ['enable_recentsearch', 'enable_backlog', 'enable_scheduled_backlog',
'scene_only', 'scene_loose', 'scene_loose_active',
'scene_rej_nuked', 'scene_nuked_active',
'search_fallback', 'server_type']
if getattr(src, x, None)]:
for attr in filter(lambda a: None is not getattr(src, a, None), (
'enable_recentsearch', 'enable_backlog', 'enable_scheduled_backlog',
'scene_only', 'scene_loose', 'scene_loose_active',
'scene_rej_nuked', 'scene_nuked_active',
'search_fallback', 'server_type')):
value = helpers.tryInt(getattr(src, attr, None))
# must allow the following to save '0' not '1' because default is enable (1) instead of disable (0)
if (value and (attr not in ('enable_recentsearch', 'enable_backlog', 'enable_scheduled_backlog'))
@ -1975,7 +1975,8 @@ def save_config():
cfg_lc = cfg.lower()
cfg_keys += [cfg]
new_config[cfg] = {}
for (k, v) in filter(lambda (_, y): any([y]), items):
for (k, v) in filter(lambda (_, y): any([y]) or (
cfg_lc in ('kodi', 'xbmc', 'synoindex') and _ in ('always_on',)), items):
k = '%s' in k and (k % cfg_lc) or (cfg_lc + '_' + k)
# correct for cases where keys are named in an inconsistent manner to parent stanza
k = k.replace('blackhole_', '').replace('sabnzbd_', 'sab_')

View file

@ -38,7 +38,7 @@ class RarbgProvider(generic.TorrentProvider):
'api_list': self.url_api + 'mode=list',
'api_search': self.url_api + 'mode=search'}
self.params = {'defaults': '&format=json_extended&category=18;41&limit=100&sort=last&ranked=%(r)s&token=%(t)s',
self.params = {'defaults': '&format=json_extended&category=18;41&limit=100&sort=last&ranked={r}&token={t}',
'param_iid': '&search_imdb=%(sid)s',
'param_tid': '&search_tvdb=%(sid)s',
'param_str': '&search_string=%(str)s',
@ -123,7 +123,7 @@ class RarbgProvider(generic.TorrentProvider):
time_out += 1
time.sleep(1)
searched_url = search_url % {'r': int(self.confirmed), 't': self.token}
searched_url = search_url.format(**{'r': int(self.confirmed), 't': self.token})
data_json = self.get_url(searched_url, json=True)
if self.should_skip():

View file

@ -32,7 +32,7 @@ class ZooqleProvider(generic.TorrentProvider):
self.url_base = 'https://zooqle.com/'
self.urls = {'config_provider_home_uri': self.url_base,
'search': self.url_base + 'search?q=%s category:%s&s=ns&v=t&sd=d',
'search': self.url_base + 'search?q=%s category:%s&s=%s&v=t&sd=d',
'get': self.url_base + 'download/%s.torrent'}
self.categories = {'Season': ['TV'], 'Episode': ['TV'], 'anime': ['Anime']}
@ -55,7 +55,8 @@ class ZooqleProvider(generic.TorrentProvider):
for search_string in search_params[mode]:
search_string = isinstance(search_string, unicode) and unidecode(search_string) or search_string
search_string = '+'.join(rc['abd'].sub(r'%22\1%22', search_string).split())
search_url = self.urls['search'] % (search_string, self._categories_string(mode, '', ','))
search_url = self.urls['search'] % (search_string, self._categories_string(mode, '', ','),
('ns', 'dt')['Cache' == mode])
html = self.get_url(search_url)
if self.should_skip():