From 35d8f18cdb7214d5adc1ad77c3ae6714a8e58cf2 Mon Sep 17 00:00:00 2001 From: jurialmunkey Date: Sun, 26 Nov 2023 19:14:30 +1100 Subject: [PATCH] :sparkles: Allow loading filterdir from file --- resources/lib/lists/filterdir.py | 2 +- resources/lib/plugin.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/lib/lists/filterdir.py b/resources/lib/lists/filterdir.py index 4939965..1eb750d 100644 --- a/resources/lib/lists/filterdir.py +++ b/resources/lib/lists/filterdir.py @@ -376,7 +376,7 @@ def _is_not_dupe(i): return i def _get_sorting(i): - return i.infolabels.get(sort_by) or i.infoproperties.get(sort_by) or '' + return str(i.infolabels.get(sort_by) or i.infoproperties.get(sort_by) or '') items = [] for path in paths: diff --git a/resources/lib/plugin.py b/resources/lib/plugin.py index 1c04619..92f9ef4 100644 --- a/resources/lib/plugin.py +++ b/resources/lib/plugin.py @@ -60,8 +60,11 @@ class Plugin(): def __init__(self, handle, paramstring): # plugin:// params configuration - from jurialmunkey.parser import parse_paramstring self.handle = handle # plugin:// handle + self.parse_paramstring(paramstring) + + def parse_paramstring(self, paramstring): + from jurialmunkey.parser import parse_paramstring self.paramstring, *secondary_params = paramstring.split('&&') # plugin://plugin.video.themoviedb.helper?paramstring self.params = parse_paramstring(self.paramstring) # paramstring dictionary if not secondary_params: @@ -78,4 +81,7 @@ def get_directory(self): return container.get_directory(**self.params) def run(self): + if self.params.get('info') == 'get_params_file': + from resources.lib.shortcuts.futils import read_meta_from_file + self.params = read_meta_from_file(self.params['paths'][0]) self.get_directory()