Skip to content

Commit

Permalink
✨ Add sum values function
Browse files Browse the repository at this point in the history
  • Loading branch information
jurialmunkey committed Sep 3, 2023
1 parent 66bb702 commit e7cd66d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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="1.1.11"
version="1.1.12"
name="Skin Variables"
provider-name="jurialmunkey">
<requires>
Expand Down
15 changes: 15 additions & 0 deletions resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,20 @@ def get_directory(self, stream_type=None, stream_index=None, **kwargs):
return


class ListGetNumberSum(Container):
def get_directory(self, expression, **kwargs):

values = [0]
values += [int(i) for i in expression.split() if i]

items = [{
'url': '',
'listitem': ListItem(label=f'{sum(values)}', label2='', path='', offscreen=True),
'isFolder': True}]

self.add_items(items)


class Plugin():
def __init__(self, handle, paramstring):
# plugin:// params configuration
Expand All @@ -279,6 +293,7 @@ def __init__(self, handle, paramstring):
'get_dbitem_season_details': ListGetSeasonDetails,
'get_dbitem_episode_details': ListGetEpisodeDetails,
'get_dbitem_addon_details': ListGetAddonDetails,
'get_number_sum': ListGetNumberSum,
}

def get_container(self, info):
Expand Down

0 comments on commit e7cd66d

Please sign in to comment.