From 811893f0fe7594fe883cb181001bc809a9846bb7 Mon Sep 17 00:00:00 2001 From: Vito0912 <86927734+Vito0912@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:56:05 +0200 Subject: [PATCH] ABOVE NOT TESTED - Added sync endpoint --- docs/controllers/SessionController.yaml | 55 ++++++++++++++++++++++++ docs/openapi.json | Bin 322500 -> 327344 bytes docs/root.yaml | 2 + 3 files changed, 57 insertions(+) create mode 100644 docs/controllers/SessionController.yaml diff --git a/docs/controllers/SessionController.yaml b/docs/controllers/SessionController.yaml new file mode 100644 index 000000000..70cab2843 --- /dev/null +++ b/docs/controllers/SessionController.yaml @@ -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 diff --git a/docs/openapi.json b/docs/openapi.json index d72acb3e6c09550a6ce5feff97d145f55ca83ea1..c5edd27062000ca9547876cbe9f45d5a7972a069 100644 GIT binary patch delta 834 zcma)4O=uHA6n-;#CK_r8jnYz@bedKxQreXs3~D6@1)B(s^dN$u(ZnWFn{{_lLaDkY?5bowWK!?9eJ#5~&$`n6Jv0Q=jArm zn(LrvTf93^;&z*J<{V#53eK>1%2U>)SLv|rtE1Aav1t6E9MHsyR2!LLS)=+F4By18tT0&>0dI{*Lx delta 32 ncmdn+SNOrqB7u!qxsEmI;WNw||IbIj{f#2$c`Q diff --git a/docs/root.yaml b/docs/root.yaml index ff2c6f21f..63462a22c 100644 --- a/docs/root.yaml +++ b/docs/root.yaml @@ -91,6 +91,8 @@ paths: $ref: './controllers/MeController.yaml#/paths/~1api~1me~1progress~1{libraryItemId}~1{episodeId}' /api/me/progress/{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: - name: Authors description: Author endpoints