Skip to content

Commit

Permalink
v5.9.x Fix issue with making minimum config
Browse files Browse the repository at this point in the history
Fix issue with config check and windows dirs
Fix issue with user builder  not showing single user
  • Loading branch information
terrelsa13 committed Sep 20, 2024
1 parent 3329fb7 commit d938582
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion mumc_modules/mumc_builder_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def show_hide_gui_disabled_users(the_dict):

def print_users_to_console(the_dict):

if (len(the_dict['all_users_dict']) > 1):
if (len(the_dict['all_users_dict']) >= 1):
for user in the_dict['all_users_dict']:
the_dict['user_index_total']=the_dict['all_users_dict'].index(user)
the_dict['all_users_dict'][the_dict['user_index_total']]['userPosition']=the_dict['user_index_total']
Expand Down
20 changes: 10 additions & 10 deletions mumc_modules/mumc_configuration_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,20 +493,20 @@ def yaml_configurationBuilder(the_dict):
config_data['advanced_settings'].pop('whitetags')
else:
config_data['advanced_settings']['whitetags']['global']=the_dict['advanced_settings']['whitetags']['global']
config_data['advanced_settings']['whitetags'].pop('movie')
config_data['advanced_settings']['whitetags'].pop('episode')
config_data['advanced_settings']['whitetags'].pop('audio')
if (the_dict['admin_settings']['server']['brand'] == 'jellyfin'):
config_data['advanced_settings']['whitetags'].pop('audiobook')
config_data['advanced_settings']['whitetags'].pop('movie')
config_data['advanced_settings']['whitetags'].pop('episode')
config_data['advanced_settings']['whitetags'].pop('audio')
if (the_dict['admin_settings']['server']['brand'] == 'jellyfin'):
config_data['advanced_settings']['whitetags'].pop('audiobook')
if (the_dict['advanced_settings']['blacktags']['global'] == []):
config_data['advanced_settings'].pop('blacktags')
else:
config_data['advanced_settings']['blacktags']['global']=the_dict['advanced_settings']['blacktags']['global']
config_data['advanced_settings']['blacktags'].pop('movie')
config_data['advanced_settings']['blacktags'].pop('episode')
config_data['advanced_settings']['blacktags'].pop('audio')
if (the_dict['admin_settings']['server']['brand'] == 'jellyfin'):
config_data['advanced_settings']['blacktags'].pop('audiobook')
config_data['advanced_settings']['blacktags'].pop('movie')
config_data['advanced_settings']['blacktags'].pop('episode')
config_data['advanced_settings']['blacktags'].pop('audio')
if (the_dict['admin_settings']['server']['brand'] == 'jellyfin'):
config_data['advanced_settings']['blacktags'].pop('audiobook')
config_data['advanced_settings'].pop('delete_empty_folders')
config_data['advanced_settings'].pop('episode_control')
config_data['advanced_settings'].pop('trakt_fix')
Expand Down
2 changes: 1 addition & 1 deletion mumc_modules/mumc_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#Get the current script version
def get_script_version():
return '5.9.12-beta'
return '5.9.13-beta'


#Get the min config version
Expand Down
10 changes: 6 additions & 4 deletions mumc_modules/mumc_yaml_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,17 @@ def cfgCheckYAML_forLibraries(check_list, user_id_check_list, user_name_check_li
if ('path' in libinfo):
path_found += 1
check_item=check_irt[user_elements][int(check_irt[user_elements].index(libinfo))]['path']
#Check path is string
if (not ((isinstance(check_item,str) and check_item.find('\\') < 0) or (check_item == '') or (check_item == None))):
#Check path is string; checking for backslashes does not work for windows
#if (not ((isinstance(check_item,str) and (check_item.find('\\') < 0)) or (check_item == '') or (check_item == None))):
if (not (isinstance(check_item,str) or (check_item == '') or (check_item == None))):
error_found_in_mumc_config_yaml+='ConfigValueError: ' + config_var_name + ' > user_id: ' + str(check_irt['user_id']) + ' > ' + user_elements + ' > library_id: ' + str(libinfo['lib_id']) + ' > path: ' + str(check_item) + ' is not an expected string value\n'

if ('network_path' in libinfo):
network_path_found += 1
check_item=check_irt[user_elements][int(check_irt[user_elements].index(libinfo))]['network_path']
#Check network_path is string
if (not ((isinstance(check_item,str) and check_item.find('\\') < 0) or (check_item == '') or (check_item == None))):
#Check network_path is string; checking for backslashes does not work for windows
#if (not ((isinstance(check_item,str) and (check_item.find('\\') < 0)) or (check_item == '') or (check_item == None))):
if (not (isinstance(check_item,str) or (check_item == '') or (check_item == None))):
error_found_in_mumc_config_yaml+='ConfigValueError: ' + config_var_name + ' > user_id: ' + str(check_irt['user_id']) + ' > ' + user_elements + ' > library_id: ' + str(libinfo['lib_id']) + ' > network_path: ' + str(check_item) + ' is not an expected string value\n'

if ('subfolder_id' in libinfo):
Expand Down

0 comments on commit d938582

Please sign in to comment.