ABOVE NOT TESTED - Added sync endpoint

This commit is contained in:
Vito0912 2024-07-30 17:56:05 +02:00
parent 5e63efd810
commit 811893f0fe
3 changed files with 57 additions and 0 deletions

View file

@ -0,0 +1,55 @@
paths:
/api/session/{id}/sync:
post:
operationId: syncOpenSession
summary: Sync an open session.
description: Sync an open session.
tags:
- Session
parameters:
- name: id
in: path
description: The ID of the session.
required: true
schema:
$ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSessionId'
- name: currentTime
in: query
description: The current time of the session.
required: true
schema:
$ref: '../schemas.yaml#/components/schemas/durationSec'
- name: timeListened
in: query
description: The time listened to the session.
required: true
schema:
$ref: '../schemas.yaml#/components/schemas/durationSec'
- name: duration
in: query
description: The duration of the session.
required: true
schema:
$ref: '../schemas.yaml#/components/schemas/durationSec'
responses:
'200':
description: OK
content:
html/text:
schema:
type: string
example: OK
'404':
description: No listening session with the provided ID is open, or the session belongs to another user.
content:
html/text:
schema:
type: string
example: Not Found
'500':
description: There was an error syncing the session.
content:
html/text:
schema:
type: string
example: Internal Server Error

Binary file not shown.

View file

@ -91,6 +91,8 @@ paths:
$ref: './controllers/MeController.yaml#/paths/~1api~1me~1progress~1{libraryItemId}~1{episodeId}' $ref: './controllers/MeController.yaml#/paths/~1api~1me~1progress~1{libraryItemId}~1{episodeId}'
/api/me/progress/{mediaId}: /api/me/progress/{mediaId}:
$ref: './controllers/MeController.yaml#/paths/~1api~1me~1progress~1{mediaId}' $ref: './controllers/MeController.yaml#/paths/~1api~1me~1progress~1{mediaId}'
/api/session/{id}/sync:
$ref: './controllers/SessionController.yaml#/paths/~1api~1session~1{id}~1sync'
tags: tags:
- name: Authors - name: Authors
description: Author endpoints description: Author endpoints