Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions resources/lib/criterion_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 11 additions & 1 deletion resources/lib/listing/listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand Down Expand Up @@ -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'])
Expand All @@ -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"]
Expand Down
4 changes: 4 additions & 0 deletions resources/lib/stash_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -119,6 +120,7 @@ def find_scene(self, id):
screenshot
}
files {
basename
duration
video_codec
audio_codec
Expand Down Expand Up @@ -150,6 +152,7 @@ def find_scene(self, id):
screenshot
}
files {
basename
duration
video_codec
audio_codec
Expand Down Expand Up @@ -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
Expand Down