Merge pull request #890 from croneter/widget-limit
Improve some PKC widgets
This commit is contained in:
commit
3627c9e6bb
4 changed files with 44 additions and 1 deletions
|
@ -1058,7 +1058,7 @@ msgstr ""
|
||||||
|
|
||||||
# PKC Settings - Appearance Tweaks
|
# PKC Settings - Appearance Tweaks
|
||||||
msgctxt "#39077"
|
msgctxt "#39077"
|
||||||
msgid "Number of PMS items to show in widgets (e.g. \"On Deck\")"
|
msgid "Maximum number of videos to show in widgets"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
# PKC Settings - Plex
|
# PKC Settings - Plex
|
||||||
|
@ -1308,6 +1308,10 @@ msgctxt "#39501"
|
||||||
msgid "Collections"
|
msgid "Collections"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#39502"
|
||||||
|
msgid "PKC On Deck (faster)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#39600"
|
msgctxt "#39600"
|
||||||
msgid "Are you sure you want to reset your local Kodi database? A re-sync of the Plex data will take time afterwards."
|
msgid "Are you sure you want to reset your local Kodi database? A re-sync of the Plex data will take time afterwards."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -28,6 +28,11 @@ NODE_TYPES = {
|
||||||
},
|
},
|
||||||
'movies',
|
'movies',
|
||||||
True),
|
True),
|
||||||
|
('pkc_ondeck',
|
||||||
|
utils.lang(39502), # "PKC On Deck (faster)"
|
||||||
|
{},
|
||||||
|
'movies',
|
||||||
|
False),
|
||||||
('recent',
|
('recent',
|
||||||
utils.lang(30174), # "Recently Added"
|
utils.lang(30174), # "Recently Added"
|
||||||
{
|
{
|
||||||
|
@ -244,6 +249,29 @@ def node_pms(section, node_name, args):
|
||||||
return xml
|
return xml
|
||||||
|
|
||||||
|
|
||||||
|
def node_pkc_ondeck(section, node_name):
|
||||||
|
"""
|
||||||
|
For movies only - returns in-progress movies sorted by last played
|
||||||
|
"""
|
||||||
|
xml = etree.Element('node', attrib={'order': unicode(section.order),
|
||||||
|
'type': 'filter'})
|
||||||
|
etree.SubElement(xml, 'match').text = 'all'
|
||||||
|
rule = etree.SubElement(xml, 'rule', attrib={'field': 'tag',
|
||||||
|
'operator': 'is'})
|
||||||
|
etree.SubElement(rule, 'value').text = section.name
|
||||||
|
etree.SubElement(xml, 'rule', attrib={'field': 'inprogress',
|
||||||
|
'operator': 'true'})
|
||||||
|
etree.SubElement(xml, 'label').text = node_name
|
||||||
|
etree.SubElement(xml, 'icon').text = ICON_PATH
|
||||||
|
etree.SubElement(xml, 'content').text = section.content
|
||||||
|
etree.SubElement(xml, 'limit').text = utils.settings('widgetLimit')
|
||||||
|
etree.SubElement(xml,
|
||||||
|
'order',
|
||||||
|
attrib={'direction':
|
||||||
|
'descending'}).text = 'lastplayed'
|
||||||
|
return xml
|
||||||
|
|
||||||
|
|
||||||
def node_recent(section, node_name):
|
def node_recent(section, node_name):
|
||||||
xml = etree.Element('node',
|
xml = etree.Element('node',
|
||||||
attrib={'order': unicode(section.order),
|
attrib={'order': unicode(section.order),
|
||||||
|
@ -266,6 +294,7 @@ def node_recent(section, node_name):
|
||||||
etree.SubElement(xml, 'label').text = node_name
|
etree.SubElement(xml, 'label').text = node_name
|
||||||
etree.SubElement(xml, 'icon').text = ICON_PATH
|
etree.SubElement(xml, 'icon').text = ICON_PATH
|
||||||
etree.SubElement(xml, 'content').text = section.content
|
etree.SubElement(xml, 'content').text = section.content
|
||||||
|
etree.SubElement(xml, 'limit').text = utils.settings('widgetLimit')
|
||||||
etree.SubElement(xml,
|
etree.SubElement(xml,
|
||||||
'order',
|
'order',
|
||||||
attrib={'direction':
|
attrib={'direction':
|
||||||
|
@ -303,6 +332,7 @@ def node_recommended(section, node_name):
|
||||||
etree.SubElement(xml, 'label').text = node_name
|
etree.SubElement(xml, 'label').text = node_name
|
||||||
etree.SubElement(xml, 'icon').text = ICON_PATH
|
etree.SubElement(xml, 'icon').text = ICON_PATH
|
||||||
etree.SubElement(xml, 'content').text = section.content
|
etree.SubElement(xml, 'content').text = section.content
|
||||||
|
etree.SubElement(xml, 'limit').text = utils.settings('widgetLimit')
|
||||||
etree.SubElement(xml,
|
etree.SubElement(xml,
|
||||||
'order',
|
'order',
|
||||||
attrib={'direction':
|
attrib={'direction':
|
||||||
|
@ -357,6 +387,7 @@ def node_random(section, node_name):
|
||||||
etree.SubElement(xml, 'label').text = node_name
|
etree.SubElement(xml, 'label').text = node_name
|
||||||
etree.SubElement(xml, 'icon').text = ICON_PATH
|
etree.SubElement(xml, 'icon').text = ICON_PATH
|
||||||
etree.SubElement(xml, 'content').text = section.content
|
etree.SubElement(xml, 'content').text = section.content
|
||||||
|
etree.SubElement(xml, 'limit').text = utils.settings('widgetLimit')
|
||||||
etree.SubElement(xml,
|
etree.SubElement(xml,
|
||||||
'order',
|
'order',
|
||||||
attrib={'direction':
|
attrib={'direction':
|
||||||
|
@ -377,6 +408,7 @@ def node_lastplayed(section, node_name):
|
||||||
etree.SubElement(xml, 'label').text = node_name
|
etree.SubElement(xml, 'label').text = node_name
|
||||||
etree.SubElement(xml, 'icon').text = ICON_PATH
|
etree.SubElement(xml, 'icon').text = ICON_PATH
|
||||||
etree.SubElement(xml, 'content').text = section.content
|
etree.SubElement(xml, 'content').text = section.content
|
||||||
|
etree.SubElement(xml, 'limit').text = utils.settings('widgetLimit')
|
||||||
etree.SubElement(xml,
|
etree.SubElement(xml,
|
||||||
'order',
|
'order',
|
||||||
attrib={'direction':
|
attrib={'direction':
|
||||||
|
|
|
@ -36,4 +36,10 @@ def check_migration():
|
||||||
from .library_sync.sections import delete_files
|
from .library_sync.sections import delete_files
|
||||||
delete_files()
|
delete_files()
|
||||||
|
|
||||||
|
if not utils.compare_version(last_migration, '2.8.3'):
|
||||||
|
LOG.info('Migrating to version 2.8.2')
|
||||||
|
from .library_sync import sections
|
||||||
|
sections.clear_window_vars()
|
||||||
|
sections.delete_videonode_files()
|
||||||
|
|
||||||
utils.settings('last_migrated_PKC_version', value=v.ADDON_VERSION)
|
utils.settings('last_migrated_PKC_version', value=v.ADDON_VERSION)
|
||||||
|
|
|
@ -158,6 +158,7 @@
|
||||||
|
|
||||||
<category label="39073"><!-- Appearance Tweaks -->
|
<category label="39073"><!-- Appearance Tweaks -->
|
||||||
<setting label="[COLOR yellow]$ADDON[plugin.video.plexkodiconnect 39085][/COLOR]" type="action" action="RunPlugin(plugin://plugin.video.plexkodiconnect?mode=refreshplaylist)" option="close" /><!-- Reload Kodi node files to apply all the settings below -->
|
<setting label="[COLOR yellow]$ADDON[plugin.video.plexkodiconnect 39085][/COLOR]" type="action" action="RunPlugin(plugin://plugin.video.plexkodiconnect?mode=refreshplaylist)" option="close" /><!-- Reload Kodi node files to apply all the settings below -->
|
||||||
|
<setting id="widgetLimit" type="slider" label="39077" default="30" range="10,10,100" option="int" /><!-- Maximum number of videos to show in widgets -->
|
||||||
<setting type="lsep" />
|
<setting type="lsep" />
|
||||||
<setting id="fetch_pms_item_number" label="39077" type="number" default="50" option="int" visible="false" />
|
<setting id="fetch_pms_item_number" label="39077" type="number" default="50" option="int" visible="false" />
|
||||||
<setting type="lsep" label="39074" /><!-- TV Shows -->
|
<setting type="lsep" label="39074" /><!-- TV Shows -->
|
||||||
|
|
Loading…
Reference in a new issue