Fix Download, Filtro Lingua, default settings
This commit is contained in:
+40
-6
@@ -170,18 +170,52 @@ def get_channel_controls_settings(channel_name):
|
||||
|
||||
def get_default_settings(channel_name):
|
||||
import filetools
|
||||
channel = __import__('channels.%s' % channel_name, fromlist=["channels.%s" % channel_name])
|
||||
try:
|
||||
list_language = channel.list_language
|
||||
list_language.insert(0, config.get_localized_string(70522))
|
||||
except:
|
||||
list_language = []
|
||||
channel_controls = get_channel_json(channel_name).get('settings', list())
|
||||
default_path = filetools.join(config.get_runtime_path(), 'default_channel_settings' + '.json')
|
||||
default_controls = jsontools.load(filetools.read(default_path)).get('settings', list())
|
||||
categories = get_channel_json(channel_name).get('categories', list())
|
||||
for control in default_controls:
|
||||
if control['id'] not in str(channel_controls):
|
||||
if control['id'] == 'include_in_newest_peliculas' and 'movie' not in categories:
|
||||
pass
|
||||
elif control['id'] == 'include_in_newest_series' and 'tvshow' not in categories:
|
||||
pass
|
||||
elif control['id'] == 'include_in_newest_anime' and 'anime' not in categories:
|
||||
pass
|
||||
if 'include_in_newest' in control['id']:
|
||||
label = control['id'].split('_')
|
||||
label = label[-1]
|
||||
if label == 'peliculas':
|
||||
if 'movie' not in categories:
|
||||
pass
|
||||
else:
|
||||
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string(30122)
|
||||
channel_controls.append(control)
|
||||
logger.info(control)
|
||||
elif label == 'series':
|
||||
if 'tvshow' not in categories:
|
||||
pass
|
||||
else:
|
||||
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string(30123)
|
||||
channel_controls.append(control)
|
||||
elif label == 'anime':
|
||||
if 'anime' not in categories:
|
||||
pass
|
||||
else:
|
||||
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string(30124)
|
||||
channel_controls.append(control)
|
||||
else:
|
||||
control['label'] = config.get_localized_string(70727) + ' - ' + label.capitalize()
|
||||
channel_controls.append(control)
|
||||
|
||||
elif control['id'] == 'filter_languages':
|
||||
if len(list_language) > 1:
|
||||
control['lvalues'] = list_language
|
||||
channel_controls.append(control)
|
||||
else:
|
||||
pass
|
||||
|
||||
|
||||
else:
|
||||
channel_controls.append(control)
|
||||
return channel_controls
|
||||
|
||||
Reference in New Issue
Block a user