Skip to content

Commit

Permalink
⚡ More control over property setter for extended details
Browse files Browse the repository at this point in the history
  • Loading branch information
jurialmunkey committed Nov 10, 2024
1 parent 94d928d commit 9b36ae7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/tmdbhelper/lib/monitor/imgmon.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from tmdbhelper.lib.monitor.images import ImageManipulations
from tmdbhelper.lib.monitor.poller import Poller
from tmdbhelper.lib.monitor.listitemtools import ListItemInfoGetter
from tmdbhelper.lib.addon.plugin import get_setting
# from tmdbhelper.lib.addon.plugin import get_setting
from threading import Thread


Expand All @@ -13,7 +13,7 @@ def __init__(self, update_monitor):
self.crop_image_cur = None
self.blur_image_cur = None
self.pre_item = None
self._readahead_li = get_setting('service_listitem_readahead') # Allows readahead queue of next ListItems when idle
self._readahead_li = True # get_setting('service_listitem_readahead') # Allows readahead queue of next ListItems when idle

def setup_current_container(self):
self._container_item = self.container_item
Expand Down
26 changes: 26 additions & 0 deletions resources/tmdbhelper/lib/monitor/propertysetter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from jurialmunkey.parser import try_type


class PropertySetter():
@property
def property_window(self):
try:
return self._property_window
except AttributeError:
import xbmcgui
try:
self._property_window = xbmcgui.Window(10000)
except RuntimeError: # If window id does not exist
return
return self._property_window

def get_property(self, name, set_property=None, clear_property=False, is_type=None):
if not self.property_window:
return
name = f'TMDbHelper.{name}'
ret_property = set_property or self.property_window.getProperty(name)
if clear_property:
self.property_window.clearProperty(name)
if set_property is not None:
self.property_window.setProperty(name, f'{set_property}')
return try_type(ret_property, is_type or str)

0 comments on commit 9b36ae7

Please sign in to comment.