Skip to content

Paging, playback reporting, favourites and continuous playback - #29

Open
anoteng wants to merge 11 commits into
gitgiggety:developfrom
anoteng:improvements
Open

anoteng wants to merge 11 commits into
gitgiggety:developfrom
anoteng:improvements

Conversation

@anoteng

@anoteng anoteng commented Oct 13, 2026

Copy link
Copy Markdown

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

  • All listings are paged (scenes/markers: configurable 20/40/60/100 per page, performers/tags/studios: 100) with a Next page item. Previously every listing fetched everything at once, which made Kodi hang.
  • requests is replaced by urllib: importing requests alone took ~1.5 s on every navigation on this device; a listing now takes ~0.25 s in total. This also drops the script.module.requests dependency.
  • Uses the InfoTagVideo API instead of the deprecated ListItem.setInfo (requires Kodi 20+, xbmc.python 3.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

  • Rate… (0–5 stars) and Performers in scene… (show scenes, information, toggle favourite) in a scene's context menu.
  • Add to / Remove from favourites for performers, tags and studios; Information for performers.
  • The O-counter uses sceneAddO, as sceneIncrementO no 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

  • Norwegian (nb_NO) translation; all labels are localizable.
  • No star glyphs in labels, as Kodi's default fonts lack them.
  • README documents the new features and two limitations of Kodi's information dialog for add-on items.

The commits are kept separate by topic; happy to split this into smaller PRs if you prefer.

ilgiaco and others added 11 commits October 13, 2026 19:16
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increment and record playback information during Kodi video playback Use file name as fallback when there's no title

2 participants