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
|
||||
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 ""
|
||||
|
||||
# PKC Settings - Plex
|
||||
|
@ -1308,6 +1308,10 @@ msgctxt "#39501"
|
|||
msgid "Collections"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#39502"
|
||||
msgid "PKC On Deck (faster)"
|
||||
msgstr ""
|
||||
|
||||
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."
|
||||
msgstr ""
|
||||
|
|
|
@ -28,6 +28,11 @@ NODE_TYPES = {
|
|||
},
|
||||
'movies',
|
||||
True),
|
||||
('pkc_ondeck',
|
||||
utils.lang(39502), # "PKC On Deck (faster)"
|
||||
{},
|
||||
'movies',
|
||||
False),
|
||||
('recent',
|
||||
utils.lang(30174), # "Recently Added"
|
||||
{
|
||||
|
@ -244,6 +249,29 @@ def node_pms(section, node_name, args):
|
|||
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):
|
||||
xml = etree.Element('node',
|
||||
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, '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':
|
||||
|
@ -303,6 +332,7 @@ def node_recommended(section, node_name):
|
|||
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':
|
||||
|
@ -357,6 +387,7 @@ def node_random(section, node_name):
|
|||
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':
|
||||
|
@ -377,6 +408,7 @@ def node_lastplayed(section, node_name):
|
|||
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':
|
||||
|
|
|
@ -36,4 +36,10 @@ def check_migration():
|
|||
from .library_sync.sections import 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)
|
||||
|
|
|
@ -158,6 +158,7 @@
|
|||
|
||||
<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 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 id="fetch_pms_item_number" label="39077" type="number" default="50" option="int" visible="false" />
|
||||
<setting type="lsep" label="39074" /><!-- TV Shows -->
|
||||
|
|
Loading…
Reference in a new issue