diff --git a/docs/bundled.yaml b/docs/bundled.yaml new file mode 100644 index 000000000..97778b05a Binary files /dev/null and b/docs/bundled.yaml differ diff --git a/docs/controllers/LibraryItemController.yaml b/docs/controllers/LibraryItemController.yaml index 013b94a6f..587bc1ec6 100644 --- a/docs/controllers/LibraryItemController.yaml +++ b/docs/controllers/LibraryItemController.yaml @@ -21,40 +21,22 @@ components: description: If requesting progress for a podcast, the episode ID to get progress for. schema: $ref: '../objects/mediaTypes/Podcast.yaml#/components/schemas/podcastId' - deviceInfo: - in: query - name: deviceInfo - description: The device information to send to the server. - schema: - $ref: '../objects/entities/Device.yaml#/components/schemas/deviceInfo' - forceDirectPlay: - in: query - name: forceDirectPlay - description: Whether to force direct play of the library item. - schema: - type: boolean - 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: + forceDirectPlay: + description: Whether to force direct play of the library item. + type: boolean + example: false + forceTranscode: + description: Whether to force transcoding of the library item. + type: boolean + example: false + supportedMimeTypes: + description: The supported mime types for the device. + type: array + items: type: string + mediaPlayer: + description: The media player to use. + type: string responses: libraryItem404: description: Not Found @@ -109,12 +91,22 @@ paths: description: Play a library item by ID. tags: - LibraryItem - parameters: - - $ref: '#/components/schemas/parameters/deviceInfo' - - $ref: '#/components/schemas/parameters/forceDirectPlay' - - $ref: '#/components/schemas/parameters/forceTranscode' - - $ref: '#/components/schemas/parameters/supportedMimeTypes' - - $ref: '#/components/schemas/parameters/mediaPlayer' + requestBody: + required: true + content: + application/json: + schema: + 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: '200': description: OK @@ -144,12 +136,22 @@ paths: description: Play a podcast by library item ID and episode ID. tags: - LibraryItem - parameters: - - $ref: '#/components/schemas/parameters/deviceInfo' - - $ref: '#/components/schemas/parameters/forceDirectPlay' - - $ref: '#/components/schemas/parameters/forceTranscode' - - $ref: '#/components/schemas/parameters/supportedMimeTypes' - - $ref: '#/components/schemas/parameters/mediaPlayer' + requestBody: + required: true + content: + application/json: + schema: + 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: '200': description: OK diff --git a/docs/controllers/MeController.yaml b/docs/controllers/MeController.yaml index 6cf1c5a72..edf7efcae 100644 --- a/docs/controllers/MeController.yaml +++ b/docs/controllers/MeController.yaml @@ -2,7 +2,7 @@ components: schemas: totalTime: description: The total time listened in seconds. - type: integer + type: number example: 123456 responses: me404: @@ -178,26 +178,26 @@ paths: type: string description: The ID of the library item. timeListening: - type: integer + type: number description: The time (in seconds) the user listened to this library item. mediaMetadata: oneOf: - $ref: '../objects/metadata/BookMetadata.yaml#/components/schemas/bookMetadata' - - $ref: '../objects/metadata/PodcastMetadata.yaml#/components/schemas/PodcastMetadata' + days: type: object description: A mapping of days to total listening times. additionalProperties: - type: integer + type: number description: The total time (in seconds) listened to on that day. dayOfWeek: type: object description: A mapping of days of the week to total listening times. additionalProperties: - type: integer + type: number description: The total time (in seconds) listened to on that day of the week. today: - type: integer + type: number description: The time (in seconds) the user has listened to library items today. recentSessions: type: array diff --git a/docs/controllers/SessionController.yaml b/docs/controllers/SessionController.yaml index 20c97e403..9e43dfb62 100644 --- a/docs/controllers/SessionController.yaml +++ b/docs/controllers/SessionController.yaml @@ -13,24 +13,20 @@ paths: 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' + requestBody: + required: true + content: + application/json: + schema: + properties: + id: + $ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSessionId' + currentTime: + $ref: '../schemas.yaml#/components/schemas/durationSec' + timeListened: + $ref: '../schemas.yaml#/components/schemas/durationSec' + duration: + $ref: '../schemas.yaml#/components/schemas/durationSec' responses: '200': description: OK @@ -223,3 +219,60 @@ paths: schema: type: string 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 diff --git a/docs/objects/entities/Device.yaml b/docs/objects/entities/Device.yaml index 89bdfcf2a..f32af6332 100644 --- a/docs/objects/entities/Device.yaml +++ b/docs/objects/entities/Device.yaml @@ -22,7 +22,7 @@ components: example: 'iPhone 12' sdkVersion: description: For an Android client, the Android SDK version of the client. - type: integer + type: string example: 49 deviceInfo: description: The device information to send to the server. diff --git a/docs/openapi.json b/docs/openapi.json index 13ea22f68..69b538137 100644 Binary files a/docs/openapi.json and b/docs/openapi.json differ diff --git a/docs/root.yaml b/docs/root.yaml index 5dc49e604..384a6242c 100644 --- a/docs/root.yaml +++ b/docs/root.yaml @@ -107,6 +107,10 @@ paths: $ref: './controllers/MeController.yaml#/paths/~1api~1me~1listening-sessions' /api/me/listening-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: - name: Authors description: Author endpoints diff --git a/unicode.dll b/unicode.dll new file mode 100644 index 000000000..7ad46dd55 Binary files /dev/null and b/unicode.dll differ