diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index fc35632d..89235c96 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -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 "" diff --git a/resources/lib/library_sync/nodes.py b/resources/lib/library_sync/nodes.py index 369f37cb..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), @@ -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': diff --git a/resources/lib/migration.py b/resources/lib/migration.py index cc9c0f69..854679d2 100644 --- a/resources/lib/migration.py +++ b/resources/lib/migration.py @@ -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) diff --git a/resources/settings.xml b/resources/settings.xml index 79212504..68406395 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -158,6 +158,7 @@ +