Repository navigation
Conversation
Large libraries (~9000 scenes) made every listing fetch everything at once, which made Kodi hang on low-end hardware. This change: - Pages all listings (scenes, markers, performers, tags, studios) with a "Next page" item; scene page size is configurable (20/40/60/100) - Adds home entries: Search, Recently added, Continue watching, Recently played, Random (seeded, so paging is stable), Favourite performers and Favourite tags - Adds a "Sort by…" context menu (title, date added, date, random, rating, play count, last played, duration, O-counter, reverse order) - Shows scene counts and favourites in performer/tag/studio listings, with images as thumb and poster - Replaces requests with urllib: importing requests took ~1.5 s per navigation on a Celeron N2840 (now ~0.25 s per listing in total) - Uses the InfoTagVideo API instead of the deprecated ListItem.setInfo (requires Kodi 20+, xbmc.python 3.0.1) - Uses sceneAddO, as sceneIncrementO no longer exists in current Stash - Uses the file's basename (without extension) as title fallback - Only lists the "Default" filter when Stash actually has one, and no longer sends "None" as sort field - Adds a Norwegian (nb_NO) translation; all labels are localizable Tested against Stash v0.31.1.
A service tracks playback of Stash streams in Kodi and reports it the way Stash' own player does (closes gitgiggety#24): - adds a play once the minimum play percent from Stash' interface settings is reached - saves the resume point and play duration every 30 seconds, on pause and on stop; playing to the end (98 %) clears the resume point - respects Stash' "track activity" setting increment_o without a scene id now applies to the scene currently playing, so it can be bound to a key: <key>RunPlugin(plugin://plugin.video.stash/?increment_o)</key>
- "Rate…" in a scene's context menu sets 0–5 stars (rating100) - "Performers in scene…" toggles a performer of the scene as favourite - Performers, tags and studios get "Add to / Remove from favourites" in their context menu
With "Play next scene automatically" enabled, selecting a scene builds a Kodi video playlist of it and the scenes after it in the listing (current and next page). Kodi then continues with the next scene and its next/previous controls work during playback. As Kodi does not offer to resume playlist items, a resume/play from beginning choice is shown when Stash has a resume point; the service seeks once playback has started.
Kodi can start the service just after the add-on was disabled, or twice when it is disabled and enabled in quick succession. Such an instance never got an abort request, so it blocked Kodi's shutdown and reported playback twice. The service now stops when the add-on is disabled or a newer instance runs.
The rating dialog showed boxes instead of ★/☆. Ratings are now shown as "1 star" … "5 stars" with the current rating preselected, and favourites are shown in gold instead of with a star prefix.
Kodi's info dialog searches its own library when a cast member is selected, which finds nothing for add-on items. "Performers in scene…" now offers to show the performer's scenes, show information (aliases, age, country, measurements, career, … and the details from Stash, in Kodi's info dialog) or toggle the favourite. Performer listings get "Information" in their context menu.
Also share the URL of a performer's scenes between "Show scenes" and other callers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes the add-on usable with large libraries on low-end hardware and adds playback reporting, favourites/ratings and continuous playback. Tested against Stash v0.31.1 with Kodi 21.2 on a Celeron N2840 (library of ~9000 scenes).
Performance
requestsis replaced byurllib: importingrequestsalone took ~1.5 s on every navigation on this device; a listing now takes ~0.25 s in total. This also drops thescript.module.requestsdependency.InfoTagVideoAPI instead of the deprecatedListItem.setInfo(requires Kodi 20+,xbmc.python3.0.1).Browsing
Playback reporting (closes #24)
A service reports playback the way Stash' own player does: a play is added once Stash' Minimum Play Percent is reached, resume point and play duration are saved every 30 s, on pause and on stop, and playing to the end clears the resume point. Stash' Track Activity setting is respected.
Favourites, rating, O-counter
sceneAddO, assceneIncrementOno longer exists.RunPlugin(plugin://plugin.video.stash/?increment_o)applies to the scene currently playing, so it can be bound to a key (see README).Continuous playback (optional, off by default)
With Play next scene automatically enabled, selecting a scene builds a playlist of it and the following scenes in the listing, so Kodi continues with the next scene and its next/previous controls work. A resume/play from beginning choice is shown when Stash has a resume point.
Other
The commits are kept separate by topic; happy to split this into smaller PRs if you prefer.