@@ -9850,6 +9850,7 @@ def _gui_edit_asset(self, object_kind, asset_ID, object_dic, categoryID = '', la
98509850
98519851 # --- Link to a local image ---
98529852 if mindex == 0:
9853+ log_debug('_gui_edit_asset() Linking local image...')
98539854 image_dir = FileName(object_dic[AInfo.key]).getDir() if object_dic[AInfo.key] else ''
98549855 log_debug('_gui_edit_asset() Initial path "{}"'.format(image_dir))
98559856 if asset_ID == ASSET_MANUAL_ID or asset_ID == ASSET_TRAILER_ID:
@@ -9869,18 +9870,20 @@ def _gui_edit_asset(self, object_kind, asset_ID, object_dic, categoryID = '', la
98699870 log_info('_gui_edit_asset() Linked {} {} "{}"'.format(object_name,
98709871 AInfo.name, image_file_path.getOriginalPath()))
98719872
9872- # --- Update Kodi image cache ---
9873- kodi_update_image_cache(image_file_path.getOriginalPath())
9873+ # Update Kodi image cache.
9874+ # TODO Only update mtime for local files and not for Kodi VFS files.
9875+ utils_update_file_mtime(image_file_path.getPath())
98749876
98759877 # --- Import an image ---
98769878 # Copy and rename a local image into asset directory.
98779879 elif mindex == 1:
9880+ log_debug('_gui_edit_asset() Importing image...')
98789881 # If assets exists start file dialog from current asset directory
98799882 image_dir = ''
98809883 if object_dic[AInfo.key]: image_dir = FileName(object_dic[AInfo.key]).getDir()
98819884 log_debug('_gui_edit_asset() Initial path "{}"'.format(image_dir))
9882- image_file = kodi_dialog_get_image( 'Select {} image'.format(AInfo.name),
9883- AInfo.exts_dialog, image_dir)
9885+ t = 'Select {} image'.format(AInfo.name)
9886+ image_file = kodi_dialog_get_image(t, AInfo.exts_dialog, image_dir)
98849887 image_FileName = FileName(image_file)
98859888 if not image_FileName.exists(): return False
98869889
@@ -9915,16 +9918,19 @@ def _gui_edit_asset(self, object_kind, asset_ID, object_dic, categoryID = '', la
99159918 AInfo.name, dest_path_FileName.getOriginalPath()))
99169919
99179920 # Update Kodi image cache.
9918- kodi_update_image_cache (dest_path_FileName.getOriginalPath ())
9921+ utils_update_file_mtime (dest_path_FileName.getPath ())
99199922
99209923 # --- Unset asset ---
99219924 elif mindex == 2:
9925+ log_debug('_gui_edit_asset() Unsetting asset...')
99229926 object_dic[AInfo.key] = ''
99239927 kodi_notify('{} {} has been unset'.format(object_name, AInfo.name))
99249928 log_info('_gui_edit_asset() Unset {} {}'.format(object_name, AInfo.name))
99259929
99269930 # --- Manual scrape and choose from a list of images ---
99279931 elif mindex >= 3:
9932+ log_debug('_gui_edit_asset() Scraping image...')
9933+
99289934 # --- Create ScrapeFactory object ---
99299935 scraper_index = mindex - len(common_menu_list)
99309936 log_debug('_gui_edit_asset() Scraper index {}'.format(scraper_index))
0 commit comments