def blur_fallback(self): if self._last_blur_fallback: return fallback = get_property('Blur.Fallback') if not fallback: return if xbmc.getCondVisibility("Skin.HasSetting(TMDbHelper.EnableBlur)"): self.blur_img = ImageFunctions(method='blur', artwork=fallback) self.blur_img.setName('blur_img') self.blur_img.start() self._last_blur_fallback = True
def process_artwork(self, details, tmdb_type): self.clear_property_list(SETMAIN_ARTWORK) if self.dbtype not in ['movies', 'tvshows', 'episodes']: if tmdb_type not in ['movie', 'tv']: return if ADDON.getSettingBool('service_fanarttv_lookup'): details = self.get_fanarttv_artwork(details, tmdb_type) if not self.is_same_item(): return self.set_iter_properties(details.get('art', {}), SETMAIN_ARTWORK) # Crop Image if details.get('clearlogo'): if xbmc.getCondVisibility("Skin.HasSetting(TMDbHelper.EnableCrop)"): self.crop_img = ImageFunctions(method='crop', artwork=details.get('clearlogo')) self.crop_img.setName('crop_img') self.crop_img.start()
def get_listitem(self): self.get_container() # Don't bother getting new details if we've got the same item if self.is_same_item(update=True): return # Parent folder item so clear properties and stop if self.get_infolabel('Label') == '..': return self.clear_properties() # Set our is_updating flag get_property('IsUpdating', 'True') # If the folder changed let's clear all the properties before doing a look-up # Possible that our new look-up will fail so good to have a clean slate if not self.is_same_folder(): self.clear_properties() # Get look-up details self.set_cur_item() # Blur Image if xbmc.getCondVisibility("Skin.HasSetting(TMDbHelper.EnableBlur)"): self.blur_img = ImageFunctions(method='blur', artwork=self.get_artwork( source=get_property('Blur.SourceImage'), fallback=get_property('Blur.Fallback'))) self.blur_img.setName('blur_img') self.blur_img.start() # Desaturate Image if xbmc.getCondVisibility("Skin.HasSetting(TMDbHelper.EnableDesaturate)"): self.desaturate_img = ImageFunctions(method='desaturate', artwork=self.get_artwork( source=get_property('Desaturate.SourceImage'), fallback=get_property('Desaturate.Fallback'))) self.desaturate_img.setName('desaturate_img') self.desaturate_img.start() # CompColors if xbmc.getCondVisibility("Skin.HasSetting(TMDbHelper.EnableColors)"): self.colors_img = ImageFunctions(method='colors', artwork=self.get_artwork( source=get_property('Colors.SourceImage'), fallback=get_property('Colors.Fallback'))) self.colors_img.setName('colors_img') self.colors_img.start() # Allow early exit to only do image manipulations if xbmc.getCondVisibility("!Skin.HasSetting(TMDbHelper.Service)"): return get_property('IsUpdating', clear_property=True) # Need a TMDb type to do a details look-up so exit if we don't have one tmdb_type = self.get_tmdb_type() if not tmdb_type: self.clear_properties() return get_property('IsUpdating', clear_property=True) # Immediately clear some properties like ratings and artwork # Don't want these to linger on-screen if the look-up takes a moment if self.dbtype not in ['episodes', 'seasons']: self.clear_property_list(SETMAIN_ARTWORK) self.clear_property_list(SETPROP_RATINGS) # Get TMDb Details tmdb_id = self.get_tmdb_id( tmdb_type, self.imdb_id, self.query, year=self.year if tmdb_type == 'movie' else None, episode_year=self.year if tmdb_type == 'tv' else None) details = self.tmdb_api.get_details(tmdb_type, tmdb_id, self.season, self.episode) if not details: self.clear_properties() return get_property('IsUpdating', clear_property=True) # Need to update Next Aired with a shorter cache time than details if tmdb_type == 'tv' and details.get('infoproperties'): details['infoproperties'].update(self.tmdb_api.get_tvshow_nextaired(tmdb_id)) # Get our artwork properties if xbmc.getCondVisibility("!Skin.HasSetting(TMDbHelper.DisableArtwork)"): thread_artwork = Thread(target=self.process_artwork, args=[details, tmdb_type]) thread_artwork.start() # Item changed whilst retrieving details so lets clear and get next item if not self.is_same_item(): ignore_keys = None if self.dbtype in ['episodes', 'seasons']: ignore_keys = SETMAIN_ARTWORK self.clear_properties(ignore_keys=ignore_keys) return get_property('IsUpdating', clear_property=True) # Get person library statistics if tmdb_type == 'person' and details.get('infolabels', {}).get('title'): if xbmc.getCondVisibility("!Skin.HasSetting(TMDbHelper.DisablePersonStats)"): details.setdefault('infoproperties', {}).update( get_person_stats(details['infolabels']['title']) or {}) # Get our item ratings if xbmc.getCondVisibility("!Skin.HasSetting(TMDbHelper.DisableRatings)"): thread_ratings = Thread(target=self.process_ratings, args=[details, tmdb_type, tmdb_id]) thread_ratings.start() self.set_properties(details) get_property('IsUpdating', clear_property=True)
def image_colors(image_colors=None, **kwargs): image_colors = ImageFunctions(method='colors', artwork=image_colors) image_colors.setName('image_colors') image_colors.start()
def blur_image(blur_image=None, **kwargs): blur_img = ImageFunctions(method='blur', artwork=blur_image) blur_img.setName('blur_img') blur_img.start()