fixed endpoints using parameters instead of body

This commit is contained in:
Vito0912 2024-08-09 17:36:48 +02:00
parent 3a91092fbf
commit 4f6c2b3ca3
No known key found for this signature in database
GPG key ID: 29A3D509FE70B237
8 changed files with 129 additions and 70 deletions

BIN
docs/bundled.yaml Normal file

Binary file not shown.

View file

@ -21,40 +21,22 @@ components:
description: If requesting progress for a podcast, the episode ID to get progress for. description: If requesting progress for a podcast, the episode ID to get progress for.
schema: schema:
$ref: '../objects/mediaTypes/Podcast.yaml#/components/schemas/podcastId' $ref: '../objects/mediaTypes/Podcast.yaml#/components/schemas/podcastId'
deviceInfo: forceDirectPlay:
in: query description: Whether to force direct play of the library item.
name: deviceInfo type: boolean
description: The device information to send to the server. example: false
schema: forceTranscode:
$ref: '../objects/entities/Device.yaml#/components/schemas/deviceInfo' description: Whether to force transcoding of the library item.
forceDirectPlay: type: boolean
in: query example: false
name: forceDirectPlay supportedMimeTypes:
description: Whether to force direct play of the library item. description: The supported mime types for the device.
schema: type: array
type: boolean items:
example: false
forceTranscode:
in: query
name: forceTranscode
description: Whether to force transcoding of the library item.
schema:
type: boolean
example: false
supportedMimeTypes:
in: query
name: supportedMimeTypes
description: The supported mime types for the device.
schema:
type: array
items:
type: string
mediaPlayer:
in: query
name: mediaPlayer
description: The media player to use.
schema:
type: string type: string
mediaPlayer:
description: The media player to use.
type: string
responses: responses:
libraryItem404: libraryItem404:
description: Not Found description: Not Found
@ -109,12 +91,22 @@ paths:
description: Play a library item by ID. description: Play a library item by ID.
tags: tags:
- LibraryItem - LibraryItem
parameters: requestBody:
- $ref: '#/components/schemas/parameters/deviceInfo' required: true
- $ref: '#/components/schemas/parameters/forceDirectPlay' content:
- $ref: '#/components/schemas/parameters/forceTranscode' application/json:
- $ref: '#/components/schemas/parameters/supportedMimeTypes' schema:
- $ref: '#/components/schemas/parameters/mediaPlayer' properties:
deviceInfo:
$ref: '../objects/entities/Device.yaml#/components/schemas/deviceInfo'
forceDirectPlay:
$ref: '#/components/schemas/forceDirectPlay'
forceTranscode:
$ref: '#/components/schemas/forceTranscode'
supportedMimeTypes:
$ref: '#/components/schemas/supportedMimeTypes'
mediaPlayer:
$ref: '#/components/schemas/mediaPlayer'
responses: responses:
'200': '200':
description: OK description: OK
@ -144,12 +136,22 @@ paths:
description: Play a podcast by library item ID and episode ID. description: Play a podcast by library item ID and episode ID.
tags: tags:
- LibraryItem - LibraryItem
parameters: requestBody:
- $ref: '#/components/schemas/parameters/deviceInfo' required: true
- $ref: '#/components/schemas/parameters/forceDirectPlay' content:
- $ref: '#/components/schemas/parameters/forceTranscode' application/json:
- $ref: '#/components/schemas/parameters/supportedMimeTypes' schema:
- $ref: '#/components/schemas/parameters/mediaPlayer' properties:
deviceInfo:
$ref: '../objects/entities/Device.yaml#/components/schemas/deviceInfo'
forceDirectPlay:
$ref: '#/components/schemas/forceDirectPlay'
forceTranscode:
$ref: '#/components/schemas/forceTranscode'
supportedMimeTypes:
$ref: '#/components/schemas/supportedMimeTypes'
mediaPlayer:
$ref: '#/components/schemas/mediaPlayer'
responses: responses:
'200': '200':
description: OK description: OK

View file

@ -2,7 +2,7 @@ components:
schemas: schemas:
totalTime: totalTime:
description: The total time listened in seconds. description: The total time listened in seconds.
type: integer type: number
example: 123456 example: 123456
responses: responses:
me404: me404:
@ -178,26 +178,26 @@ paths:
type: string type: string
description: The ID of the library item. description: The ID of the library item.
timeListening: timeListening:
type: integer type: number
description: The time (in seconds) the user listened to this library item. description: The time (in seconds) the user listened to this library item.
mediaMetadata: mediaMetadata:
oneOf: oneOf:
- $ref: '../objects/metadata/BookMetadata.yaml#/components/schemas/bookMetadata' - $ref: '../objects/metadata/BookMetadata.yaml#/components/schemas/bookMetadata'
- $ref: '../objects/metadata/PodcastMetadata.yaml#/components/schemas/PodcastMetadata'
days: days:
type: object type: object
description: A mapping of days to total listening times. description: A mapping of days to total listening times.
additionalProperties: additionalProperties:
type: integer type: number
description: The total time (in seconds) listened to on that day. description: The total time (in seconds) listened to on that day.
dayOfWeek: dayOfWeek:
type: object type: object
description: A mapping of days of the week to total listening times. description: A mapping of days of the week to total listening times.
additionalProperties: additionalProperties:
type: integer type: number
description: The total time (in seconds) listened to on that day of the week. description: The total time (in seconds) listened to on that day of the week.
today: today:
type: integer type: number
description: The time (in seconds) the user has listened to library items today. description: The time (in seconds) the user has listened to library items today.
recentSessions: recentSessions:
type: array type: array

View file

@ -13,24 +13,20 @@ paths:
required: true required: true
schema: schema:
$ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSessionId' $ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSessionId'
- name: currentTime requestBody:
in: query required: true
description: The current time of the session. content:
required: true application/json:
schema: schema:
$ref: '../schemas.yaml#/components/schemas/durationSec' properties:
- name: timeListened id:
in: query $ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSessionId'
description: The time listened to the session. currentTime:
required: true $ref: '../schemas.yaml#/components/schemas/durationSec'
schema: timeListened:
$ref: '../schemas.yaml#/components/schemas/durationSec' $ref: '../schemas.yaml#/components/schemas/durationSec'
- name: duration duration:
in: query $ref: '../schemas.yaml#/components/schemas/durationSec'
description: The duration of the session.
required: true
schema:
$ref: '../schemas.yaml#/components/schemas/durationSec'
responses: responses:
'200': '200':
description: OK description: OK
@ -223,3 +219,60 @@ paths:
schema: schema:
type: string type: string
example: Not Found example: Not Found
/api/session/local:
post:
operationId: createLocalSession
summary: Create a local session.
description: Create a local session.
tags:
- Session
requestBody:
required: true
content:
application/json:
schema:
$ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSession'
responses:
'200':
description: OK
content:
html/text:
schema:
type: string
example: OK
'500':
description: There was an error creating the session.
content:
html/text:
schema:
type: string
example: Internal Server Error
/api/local/session/local-all:
post:
operationId: createLocalSessionAll
summary: Create a local session for all users.
description: Create a local session for all users.
tags:
- Session
requestBody:
required: true
content:
application/json:
schema:
items:
$ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSession'
responses:
'200':
description: OK
content:
html/text:
schema:
type: string
example: OK
'500':
description: There was an error creating the session.
content:
html/text:
schema:
type: string
example: Internal Server Error

View file

@ -22,7 +22,7 @@ components:
example: 'iPhone 12' example: 'iPhone 12'
sdkVersion: sdkVersion:
description: For an Android client, the Android SDK version of the client. description: For an Android client, the Android SDK version of the client.
type: integer type: string
example: 49 example: 49
deviceInfo: deviceInfo:
description: The device information to send to the server. description: The device information to send to the server.

Binary file not shown.

View file

@ -107,6 +107,10 @@ paths:
$ref: './controllers/MeController.yaml#/paths/~1api~1me~1listening-sessions' $ref: './controllers/MeController.yaml#/paths/~1api~1me~1listening-sessions'
/api/me/listening-stats: /api/me/listening-stats:
$ref: './controllers/MeController.yaml#/paths/~1api~1me~1listening-stats' $ref: './controllers/MeController.yaml#/paths/~1api~1me~1listening-stats'
/api/session/local:
$ref: './controllers/SessionController.yaml#/paths/~1api~1session~1local'
/api/local/session/local-all:
$ref: './controllers/SessionController.yaml#/paths/~1api~1local~1session~1local-all'
tags: tags:
- name: Authors - name: Authors
description: Author endpoints description: Author endpoints

BIN
unicode.dll Normal file

Binary file not shown.