diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 8e5c8ac..ef4a378 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -19,7 +19,7 @@ jobs: cd /tmp/ zip -r plugin.video.stash.zip plugin.video.stash/ - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: plugin.video.stash.zip path: /tmp/plugin.video.stash.zip @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest needs: ['build'] steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: plugin.video.stash.zip - uses: marvinpinto/action-automatic-releases@v1.2.1 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index eee8065..43568fe 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,7 +20,7 @@ jobs: cd /tmp/ zip -r plugin.video.stash.zip plugin.video.stash/ - name: Upload - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: plugin.video.stash.zip path: /tmp/plugin.video.stash.zip diff --git a/resources/lib/criterion_parser.py b/resources/lib/criterion_parser.py index c49826f..260086b 100644 --- a/resources/lib/criterion_parser.py +++ b/resources/lib/criterion_parser.py @@ -60,6 +60,9 @@ def parse_criterion(criterion, value_transformer): elif isinstance(value, dict) and not value.keys() - ['endpoint', 'stashID']: filter['endpoint'] = value.get('endpoint') filter['stash_id'] = value.get('stashID') + elif isinstance(value, dict) and not value.keys() - ['value', 'distance']: + filter['value'] = value['value'] + filter['distance'] = value['distance'] else: filter['value'] = value_transformer(value) diff --git a/resources/lib/listing/listing.py b/resources/lib/listing/listing.py index a93d503..f84cd9a 100644 --- a/resources/lib/listing/listing.py +++ b/resources/lib/listing/listing.py @@ -10,6 +10,12 @@ from resources.lib.navigation import NavigationItem +def to_ddmmyyy(yyyymmdd: str): + if yyyymmdd is None: + return None + return yyyymmdd[8:] + "-" + yyyymmdd[5:7] + "-" + yyyymmdd[:4] + + class Listing(ABC): handle: int @@ -32,7 +38,8 @@ def list_items(self, params: dict): for (item, url) in self._create_items(criterion, sort_field, sort_dir, params): xbmcplugin.addDirectoryItem(self.handle, url, item, False) - xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_NONE) + xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_VIDEO_SORT_TITLE) + xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_DATE) xbmcplugin.endOfDirectory(self.handle) def get_root_item(self, override_title: str = "") -> (xbmcgui.ListItem, str): @@ -77,6 +84,8 @@ def _create_item(self, scene: dict, **kwargs): title = kwargs['title'] if 'title' in kwargs else scene['title'] screenshot = kwargs['screenshot'] if 'screenshot' in kwargs else scene['paths']['screenshot'] file = scene['files'][0] + if not title and file is not None: + title = file['basename'] # / 10 because rating is 1 to 100 and Kodi uses 1 to 10 rating = round(scene['rating100'] / 10 if 'rating100' in scene and scene['rating100'] is not None else 0) duration = int(file['duration']) @@ -90,6 +99,7 @@ def _create_item(self, scene: dict, **kwargs): 'studio': scene['studio']['name'] if scene['studio'] is not None else None, 'userrating': rating, 'premiered': scene['date'], + 'date': to_ddmmyyy(scene['date']), 'tag': list(map(lambda t: t['name'], scene['tags'])), 'dateadded': scene['created_at'], 'lastplayed': scene["last_played_at"] diff --git a/resources/lib/stash_interface.py b/resources/lib/stash_interface.py index c28a177..297ad48 100644 --- a/resources/lib/stash_interface.py +++ b/resources/lib/stash_interface.py @@ -61,6 +61,7 @@ def find_scenes(self, scene_filter=None, sort_field='title', sort_dir='asc'): screenshot } files { + basename duration video_codec audio_codec @@ -119,6 +120,7 @@ def find_scene(self, id): screenshot } files { + basename duration video_codec audio_codec @@ -150,6 +152,7 @@ def find_scene(self, id): screenshot } files { + basename duration video_codec audio_codec @@ -300,6 +303,7 @@ def find_scene_markers(self, markers_filter=None, sort_field='title', sort_dir=0 screenshot } files { + basename duration video_codec audio_codec