@@ -50,8 +50,8 @@ def load_local_TOC(context, asset_type):
5050
5151 assets = []
5252
53- name = 'bl_ext.user_default.' + basename ( dirname ( dirname ( dirname ( __file__ ))) )
54- user_preferences = context . preferences . addons [ name ]. preferences
53+ user_preferences = get_addon_preferences ( context )
54+
5555
5656 filepath = join (user_preferences .global_dir , 'local_assets_' + asset_type .lower () + '.json' )
5757 if isfile (filepath ):
@@ -68,8 +68,7 @@ def load_local_TOC(context, asset_type):
6868
6969
7070def load_patreon_assets (context ):
71- name = 'bl_ext.user_default.' + basename (dirname (dirname (dirname (__file__ ))))
72- user_preferences = context .preferences .addons [name ].preferences
71+ user_preferences = get_addon_preferences (context )
7372 LOL_HOST_URL = user_preferences .lol_host
7473 LOL_VERSION = user_preferences .lol_version
7574 LOL_HTTP_HOST = user_preferences .lol_http_host
@@ -123,8 +122,7 @@ def download_table_of_contents(context):
123122 global bg_threads
124123 scene = context .scene
125124 ui_props = context .scene .luxcoreOL .ui
126- name = 'bl_ext.user_default.' + basename (dirname (dirname (dirname (__file__ ))))
127- user_preferences = context .preferences .addons [name ].preferences
125+ user_preferences = get_addon_preferences (context )
128126 LOL_HOST_URL = user_preferences .lol_host
129127 LOL_VERSION = user_preferences .lol_version
130128 LOL_HTTP_HOST = user_preferences .lol_http_host
@@ -708,8 +706,7 @@ def bg_load_previews(context, asset_type):
708706def bg_download_thumbnails (context , download_queue ):
709707 import urllib .request
710708
711- name = 'bl_ext.user_default.' + basename (dirname (dirname (dirname (__file__ ))))
712- user_preferences = context .preferences .addons [name ].preferences
709+ user_preferences = get_addon_preferences (context )
713710 LOL_HOST_URL = user_preferences .lol_host
714711 LOL_VERSION = user_preferences .lol_version
715712 LOL_HTTP_HOST = user_preferences .lol_http_host
0 commit comments