Skip to main content
Version: Next

Notifications

Notifications are sent from the server to connected clients to inform them of events.

Launching

running

Media started running on the server.

Readers

readers.added

A new reader was connected to the server.

Response

KeyTypeRequiredDescription
connectedbooleanYesWhether the reader is connected.
driverstringYesDriver type for the reader.
pathstringYesSystem path or identifier of reader.

readers.removed

A connected reader was disconnected from the server.

Response

KeyTypeRequiredDescription
connectedbooleanYesWhether the reader is connected.
driverstringYesDriver type for the reader.
pathstringYesSystem path or identifier of reader.

Tokens

tokens.added

A token was detected by a connected reader.

Response

KeyTypeRequiredDescription
typestringYesType of token (e.g., "nfc", "barcode").
uidstringYesUnique identifier of the token.
textstringNoText data associated with the token.
datastringNoRaw binary data of the token (base64 encoded).
scanTimestringYesISO 8601 timestamp when token was scanned.

tokens.removed

A token was removed from a connected reader.

Response

Returns null.

Media

media.started

New media was started on server.

Response

KeyTypeRequiredDescription
systemIdstringYesInternal ID of system associated with media.
systemNamestringYesDisplay name of system.
mediaPathstringYesPath to media file on server.
mediaNamestringYesCleaned display title of media.

Example

{
"systemId": "SNES",
"systemName": "Super Nintendo Entertainment System",
"mediaPath": "/roms/snes/Super_Mario_World_(USA)_[!].sfc",
"mediaName": "Super Mario World"
}

media.stopped

Media has stopped on server.

Response

Returns null.

media.indexing

Sent during media database generation to indicate indexing progress and completion status, as well as database optimization progress.

Priority: Indexing takes priority over optimization in notifications. If both are running, only indexing status will be shown. Optimization status is shown when no indexing is in progress.

Parameters

KeyTypeRequiredDescription
existsbooleanYesTrue if media database exists.
indexingbooleanYesTrue if indexing is currently in progress.
optimizingbooleanYesTrue if database optimization is currently in progress.
totalStepsnumberNoTotal number of systems to process during indexing.
currentStepnumberNoCurrent system being processed during indexing (1-based).
currentStepDisplaystringNoDisplay name of current system being indexed, or optimization step name (e.g., "vacuum").
totalFilesnumberNoTotal number of media files discovered during indexing.
totalMedianumberNoTotal number of media entries in the database. Only included when database exists and is ready.

Indexing Progress: Track using currentStep out of totalSteps systems processed.

Optimization Progress: When optimizing is true and indexing is false, currentStepDisplay shows the optimization operation name (e.g., "vacuum", "analyze").

Examples

Indexing In Progress
{
"jsonrpc": "2.0",
"method": "media.indexing",
"params": {
"exists": true,
"indexing": true,
"optimizing": false,
"totalSteps": 50,
"currentStep": 25,
"currentStepDisplay": "SNES",
"totalFiles": 1523
}
}
Optimization In Progress
{
"jsonrpc": "2.0",
"method": "media.indexing",
"params": {
"exists": true,
"indexing": false,
"optimizing": true,
"currentStepDisplay": "vacuum",
"totalMedia": 5432
}
}
Database Ready
{
"jsonrpc": "2.0",
"method": "media.indexing",
"params": {
"exists": true,
"indexing": false,
"optimizing": false,
"totalMedia": 5432
}
}

Playtime

playtime.limit.reached

Sent when a playtime limit (session or daily) has been reached and enforced by the system. The currently playing game will be stopped when this notification is sent.

Parameters

KeyTypeRequiredDescription
reasonstringYesThe type of limit that was reached: "session" or "daily".

Examples

Session Limit Reached
{
"jsonrpc": "2.0",
"method": "playtime.limit.reached",
"params": {
"reason": "session"
}
}
Daily Limit Reached
{
"jsonrpc": "2.0",
"method": "playtime.limit.reached",
"params": {
"reason": "daily"
}
}

playtime.limit.warning

Sent at configured time intervals to warn that a playtime limit is approaching. These notifications are sent based on the warnings configuration (e.g., at 5 minutes, 2 minutes, and 1 minute before limit).

The warning applies to whichever limit will be reached first (session or daily).

Parameters

KeyTypeRequiredDescription
intervalstringYesThe configured warning interval that triggered this notification (Go duration format).
remainingstringYesThe actual time remaining before the limit is reached (Go duration format).

Note: remaining may differ slightly from interval due to timing precision.

Example

{
"jsonrpc": "2.0",
"method": "playtime.limit.warning",
"params": {
"interval": "5m",
"remaining": "4m58s"
}
}