From a463bd521f59bcbacb179aba08c016a964ab32d4 Mon Sep 17 00:00:00 2001 From: croneter Date: Fri, 14 Jun 2019 18:07:19 +0200 Subject: [PATCH] Add an additional, faster On Deck node for movies --- .../resource.language.en_gb/strings.po | 4 +++ resources/lib/library_sync/nodes.py | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index c85caabd..89235c96 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -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 "" diff --git a/resources/lib/library_sync/nodes.py b/resources/lib/library_sync/nodes.py index 82c32394..76b41c16 100644 --- a/resources/lib/library_sync/nodes.py +++ b/resources/lib/library_sync/nodes.py @@ -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),