Skip to content

Commit

Permalink
✨ Allow building template with modal dialog progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jurialmunkey committed Apr 28, 2024
1 parent 391a60e commit 75ff44b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="script.skinvariables"
version="2.1.10"
version="2.1.11"
name="Skin Variables"
provider-name="jurialmunkey">
<requires>
Expand Down
10 changes: 7 additions & 3 deletions resources/lib/shortcuts/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import xbmcaddon
from json import loads
from jurialmunkey.logger import TimerFunc
from jurialmunkey.parser import parse_math
from jurialmunkey.parser import parse_math, boolean
from jurialmunkey.futils import load_filecontent, write_skinfile, make_hash
from resources.lib.kodiutils import ProgressDialog, get_localized
from resources.lib.operations import RuleOperations, check_condition
Expand Down Expand Up @@ -267,7 +267,7 @@ def create_xml(self):
content = pretty_xmlcontent(content)
return content

def update_xml(self, force=False, no_reload=False, genxml='', **kwargs):
def update_xml(self, force=False, no_reload=False, genxml='', background=True, **kwargs):
if not self.meta:
return

Expand Down Expand Up @@ -299,7 +299,11 @@ def is_updated():
return

with TimerFunc('script.skinvariables - update_xml: ', log_threshold=0.001, inline=True):
with ProgressDialog(ADDON.getLocalizedString(32001), f'{get_localized(32049)}...', logging=2, total=4) as self.p_dialog:
with ProgressDialog(
ADDON.getLocalizedString(32001),
f'{get_localized(32049)}...',
logging=2, total=4, background=boolean(background)
) as self.p_dialog:
self.meta['genxml'] += [{k: v for j in i.split('|') for k, v in (j.split('='), )} for i in genxml.split('||')] if genxml else []
self.meta['getnfo'] = {k: xbmc.getInfoLabel(v) for k, v in self.meta['getnfo'].items()} if 'getnfo' in self.meta else {}
self.meta['getnfo'].update(kwargs)
Expand Down

0 comments on commit 75ff44b

Please sign in to comment.