Skip to content

Browse and play an XBVR library, as well as Stash - #86

Merged
seaweeduk merged 1 commit into
masterfrom
feature/xbvr
Nov 19, 2026
Merged

seaweeduk merged 1 commit into
masterfrom
feature/xbvr

Conversation

@seaweeduk

Copy link
Copy Markdown
Owner

VideoFrameVR can use an XBVR server the way it uses Stash: browse its scenes, performers, studios and tags, play a scene from a folder here or from the server's stream, and send ratings back. One server is in use at a time. Each kind keeps its own setup, so going to the other and back loses nothing.

The Scenes page listing an XBVR library

For users

  • First-run setup asks for the server's address and finds out whether Stash or XBVR answers there. Only Stash has a login, so only Stash asks you to sign in.
  • Settings → Stash / XBVR starts with Off, Stash and XBVR. A kind you have set up is used at once, with everything as you left it: address, API key, folders, filters, sorts and whether ratings are sent. A kind you haven't set up asks for its address first.
  • Playing: a scene streams from the server over HTTP with seeking. XBVR's is never DLNA, and XBVR starts no watch session of its own. A scene you also have in a folder here plays from that folder.
  • With a scene: its cover, cast, site and tags, the preview XBVR made for it, and the subtitles and funscript XBVR lists beside its video.
  • Send ratings and plays to XBVR (off by default): a new rating is sent as it is, and a scene you play is marked as watched. XBVR keeps no time for a play, so none is sent. Tags aren't edited and files aren't deleted through XBVR.
  • Videos XBVR keeps on Put.io aren't listed: XBVR only redirects to those.

A Stash-only profile reads and writes the settings file every release wrote. Stash's local copy, queued changes, saved downloads and pinned lists are read as they are.

Before After
Before: a section named Stash with a Use Stash switch After: a section named Stash / XBVR with Off, Stash and XBVR

If you choose one kind and type the other's address, the app sets up the one that answers and says so.

Folders are chosen, not typed

This changes Stash too. The server editor used to have two typed fields, the folder as the server names it and the same folder here, which meant knowing a path such as smb://nas/videos. They are gone. The editor has the address, and for Stash the sign-in and API key. XBVR's API takes no login.

Before After
Before: Stash's editor with its two typed folder fields After: Stash's editor with Server, User name, Password and API key

Settings lists the server's library folders after the first sync, under Play from a folder. It's optional: videos you also have here seek faster from their folder, and still play when the server is down. Each folder shows where it plays from here, or that it plays from the server.

Settings with XBVR synced: one folder plays from Home/media/vr, the other plays from XBVR

Choose… opens the file browser. Use this folder checks that the server's videos are in it. Play from XBVR goes back to streaming that folder, and leaves the others as they are.

The file browser choosing the folder with XBVR's videos, with Cancel, Play from XBVR and Use this folder

Right after you connect a server, the app looks for its folders on this device and on the computers under Network. A folder found in one place is used without asking, that one time. A folder found in several is offered with Use, and you decide.

How it's built

flowchart LR
  subgraph shared [Shared]
    direction TB
    A[Sync and local copy] --> B[Catalog] --> C[Menu pages]
    D[Stream, images, previews]
    E[Write-back queue]
  end
  shared --> S{{MediaServer / MediaClient}}
  S --> T["Stash<br>stash_server.cpp, stash_client.cpp<br>GraphQL"]
  S --> X["XBVR<br>xbvr_server.cpp, xbvr_client.cpp<br>REST"]
Loading

Everything a kind of server does differently sits behind two interfaces. A further kind is two files and a line in the registry (media_server.cpp).

class MediaServer {
  virtual const char* name() const = 0;              // "Stash", "XBVR"
  virtual ServerAbilities abilities() const = 0;     // signIn, editTags, deleteFiles, playTimes
  virtual std::unique_ptr<MediaClient> client(...) const = 0;  // sync and write-back
  virtual std::string streamPath(int64_t scene, int64_t file) const = 0;
  virtual std::string previewPath(int64_t scene, const std::string& code) const = 0;
  virtual std::string imagePath(const StashAddress&, const std::string& url) const = 0;
  virtual std::vector<ServerCaption> captions(const ServerLink&, int64_t scene) const = 0;
  virtual std::string funscript(const ServerLink&, int64_t scene) const = 0;
};
  • Abilities, not kinds, in shared code. The menu hides the API key, sign-in and Edit tags where the server can't do them, and write-back sends one "watched" in place of play times where playTimes is false.

  • A setup per kind. Settings::stash is the setup in use and otherServers holds the rest. useServer() swaps them. In settings.conf each kind's lines carry its id, and Stash's are the ones it always had:

    media_server=xbvr       # written only while a kind other than Stash is in use
    stash_url=https://stash.example.com
    stash_api_key=...
    xbvr_url=http://192.168.1.20:9999
    xbvr_path_from=/mnt/media/vr
    xbvr_path_to=smb://nas/media/vr
  • Kept apart on disk. The local copy and image cache are per kind (stash.db, xbvr.db). Queued changes, download sources and pinned lists are kept by kind as well as address, so two kinds at one address never share them. Stash's keep the names they had.

  • The server's name in the menu. The language tables write "Stash". setServerName() shows a copy with the name of the server in use in its place, in every language, and stringsNamed() gives one for a kind that isn't in use yet.

  • Finding the kind. findServer() asks each kind in turn at the address typed (https, http, port 9999), the chosen kind first, without changing anything on the server.

What is asked of XBVR:

For Request
Which server, and its version GET /api.json
Scenes with files, cast and tags POST /api/scene/list (available scenes, 500 a page; read again if the pages don't fit together)
Site logos, library folders GET /api/options/sites, GET /api/options/storage
A file, subtitles, a funscript GET /api/dms/file/<id>?dnt=true
A preview, an image GET /api/dms/preview/<scene>, GET /img/<url>
A rating POST /api/scene/rate/<id>
Watched POST /api/scene/toggle, only for a scene XBVR has as not watched, checked before and after

The XBVR client refuses to send any other change.

Important

AI disclosure

Model Variant Role
anthropic/claude-opus-5-5 high Planning, implementation
openai/gpt-6.2-sol high Test server setup, screenshots
openai/gpt-6.2-astra high Independent review

Agent harness OpenCode 2.3.0 to 2.3.2

@seaweeduk seaweeduk added the feature New feature (release notes: New) label Nov 19, 2026
@opencode-agent

Copy link
Copy Markdown
  1. Medium — The XBVR bulk-send confirmation promises that existing ratings are safe to overwrite. src/strings.cpp:554–555 says “Existing XBVR ratings stay unchanged,” but makePlan() queues every nonzero local rating that differs from the server rating (src/stash_write_back.cpp:199–203). If a scene has five stars on XBVR and two locally, confirming Send replaces the five with two. Update the XBVR confirmation and its translations to say that differing server ratings will be replaced by the local ratings shown in the preview.

  2. Medium — “Play from XBVR” cannot override same-path local playback. src/menu_stash_folders.cpp:131–135 only offers the action for an explicit mapping, and src/stash.cpp:382–403 implements it by removing that mapping. On a desktop where XBVR and the player both see /mnt/videos, the folder plays locally without an explicit mapping, so the action is absent. Even if the user explicitly chooses that same folder first, removing the last mapping restores the implicit local path (StashSettings::localPath(), lines 177–183). Record an explicit stream-only choice for the selected folder and offer it whenever that folder plays locally. This also avoids changing the resolution of unrelated folders when the last mapping is removed.

  3. Medium — The XBVR sync diagnostic exposes media folder paths. src/stash.cpp:506–510 prints both the folder returned by XBVR and its mapped location on the device. Running --stash-sync writes those strings to the console and the persistent run log, which is later included in the diagnostics ZIP. The run-log redactor masks the home prefix, username and registered hosts, but not arbitrary folder names. Print a folder number and the existing counts instead of f.folder and here.

  4. Medium — A certificate error on another port can prevent discovery of a reachable XBVR server. src/media_client.cpp:184–197,243–245 uses the highest-ranked error to decide whether to try the next server kind. For example, enter a bare NAS hostname with a self-signed HTTPS admin page on port 443 and XBVR on HTTP port 9999. The Stash probe gets a certificate error on 443 and a non-Stash HTTP response on 9999. The certificate error wins, foreign_ is false, and first-run setup never asks XBVR for /api.json. Track whether any candidate returned a nonmatching HTTP response separately from the error to display; probe the other kind before presenting that error.

  5. Low — Pinned lists are shared between different XBVR addresses. src/menu_stash_lists.cpp:154–155 uses xbvr_lists.conf for every XBVR server, and src/menu_stash.cpp:24–29 resets the loaded pins only when the kind changes. After pinning a performer list on one XBVR instance and editing the address to point to another, the old pin remains visible and its numeric performer ID can select an unrelated person. Key XBVR pins by normalized server identity and reload them when that identity changes, while preserving the existing Stash pin file.

github run

@seaweeduk
seaweeduk force-pushed the feature/funscript-rework branch from 941d2d4 to 012ec60 Compare November 19, 2026 23:25
@seaweeduk
seaweeduk changed the base branch from feature/funscript-rework to master November 19, 2026 23:25
@seaweeduk
seaweeduk merged commit be3c9bc into master Nov 19, 2026
3 checks passed
@seaweeduk
seaweeduk deleted the feature/xbvr branch November 19, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature (release notes: New)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant