stash_vroom.heresphere module

This module provides a convenient way to serve Stash content to HereSphere and easily handle user events and interactions without writing an entire web service.

Example

Here’s a basic example of using the HereSphere API:

from stash_vroom.heresphere import on_event

@on_event('play')
def on_play(scene):
    print(f"Playing scene: {scene.title}")

@on_event('favorite')
def on_favorite(scene):
    print(f"Marking scene as favorite: {scene.title}")

@on_event('un-favorite')
def on_unfavorite(scene):
    print(f"Marking scene as not favorite: {scene.title}")
class stash_vroom.heresphere.HereSphereApp(name: str)[source]

Bases: object

Main class for the HereSphere application.

Similar to Flask’s Flask class, this manages event handlers and provides decorators for registering them.

on_event(event_name: str)[source]

Decorator for registering event handlers.

Parameters:

event_name – Name of the event to handle (e.g., “delete”, “favorite”, “play”)

Returns:

Decorator function

trigger_event(event_name: str, scene: Scene) List[Any][source]

Trigger an event and call all registered handlers.

Parameters:
  • event_name – Name of the event to trigger

  • scene – Scene object to pass to handlers

Returns:

List of results from all handlers

class stash_vroom.heresphere.Scene(id: str, title: str, path: str, metadata: Dict[str, Any] | None = None)[source]

Bases: object

Represents a video scene in HereSphere.

This is a simplified representation that will be passed to event handlers.

stash_vroom.heresphere.on_event(event_name: str)[source]

Decorator for registering event handlers on the global app.

Parameters:

event_name – Name of the event to handle

Returns:

Decorator function

stash_vroom.heresphere.trigger_event(event_name: str, scene: Scene) List[Any][source]

Trigger an event on the global app.

Parameters:
  • event_name – Name of the event to trigger

  • scene – Scene object to pass to handlers

Returns:

List of results from all handlers