Skip to content

Commit

Permalink
✨ Allow loading filterdir from file
Browse files Browse the repository at this point in the history
  • Loading branch information
jurialmunkey committed Nov 26, 2023
1 parent f928cf6 commit 35d8f18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/lib/lists/filterdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion resources/lib/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()

0 comments on commit 35d8f18

Please sign in to comment.