diff --git a/output/plex-media-server-spec-dereferenced.yaml b/output/plex-media-server-spec-dereferenced.yaml index 9f2dca1c..0dddf362 100644 --- a/output/plex-media-server-spec-dereferenced.yaml +++ b/output/plex-media-server-spec-dereferenced.yaml @@ -3404,7 +3404,7 @@ paths: tags: - Library summary: Search Library - operationId: searchLibrary + operationId: get-search-library description: | Search for content within a specific section of the library. @@ -3589,20 +3589,18 @@ paths: get: tags: - Library - summary: Get Items Metadata + summary: Get Metadata by RatingKey description: | This endpoint will return the metadata of a library item specified with the ratingKey. - operationId: getMetadata + operationId: get-meta-data-by-rating-key parameters: - name: ratingKey - description: the id of the library item to return the children of. in: path - schema: - type: number + description: the id of the library item to return the children of. + schema: null + type: integer + example: 9518 required: true - examples: - rating-key: - value: 17 responses: '200': description: The metadata of the library item. @@ -4101,6 +4099,206 @@ paths: status: type: number example: 401 + '/library/metadata/{ratingKey}/banner': + get: + summary: Get Banner Image + description: Gets the banner image of the media item + operationId: get-banner-image + parameters: + - name: ratingKey + in: path + description: the id of the library item to return the children of. + schema: + type: integer + example: 9518 + required: true + - name: width + in: query + required: true + schema: + type: integer + example: 396 + - name: height + in: query + required: true + schema: + type: integer + example: 396 + - name: minSize + in: query + required: true + schema: + type: integer + example: 1 + - name: upscale + in: query + required: true + schema: + type: integer + example: 1 + responses: + '200': + description: Successful response returning an image + headers: + X-Plex-Protocol: + description: Version of the Plex protocol + schema: + type: string + example: '1.0' + Content-Type: + description: The MIME type of the returned content + schema: + type: string + example: image/jpeg + Connection: + description: Connection type + schema: + type: string + example: Keep-Alive + Keep-Alive: + description: Keep-Alive header with timeout value + schema: + type: string + example: timeout=20 + Content-Encoding: + description: Content encoding method + schema: + type: string + example: gzip + X-Plex-Content-Original-Length: + description: Original length of the uncompressed content + schema: + type: integer + format: int32 + example: 92476 + X-Plex-Content-Compressed-Length: + description: Length of the compressed content + schema: + type: integer + format: int32 + example: 92483 + Content-Length: + description: Length of the response content + schema: + type: integer + format: int32 + example: 92483 + Cache-Control: + description: Cache control directives + schema: + type: string + example: max-age=259200 + Date: + description: Date and time the response was generated + schema: + type: string + format: date-time + example: 'Tue, 03 Sep 2024 10:48:05 GMT' + content: + image/jpeg: + schema: + type: string + format: binary + '/library/metadata/{ratingKey}/thumb': + get: + summary: Get Banner Image + description: Gets the banner image of the media item + operationId: get-thumb-image + parameters: + - name: ratingKey + in: path + description: the id of the library item to return the children of. + schema: + type: integer + example: 9518 + required: true + - name: width + in: query + required: true + schema: + type: integer + example: 396 + - name: height + in: query + required: true + schema: + type: integer + example: 396 + - name: minSize + in: query + required: true + schema: + type: integer + example: 1 + - name: upscale + in: query + required: true + schema: + type: integer + example: 1 + responses: + '200': + description: Successful response returning an image + headers: + X-Plex-Protocol: + description: Version of the Plex protocol + schema: + type: string + example: '1.0' + Content-Type: + description: The MIME type of the returned content + schema: + type: string + example: image/jpeg + Connection: + description: Connection type + schema: + type: string + example: Keep-Alive + Keep-Alive: + description: Keep-Alive header with timeout value + schema: + type: string + example: timeout=20 + Content-Encoding: + description: Content encoding method + schema: + type: string + example: gzip + X-Plex-Content-Original-Length: + description: Original length of the uncompressed content + schema: + type: integer + format: int32 + example: 92476 + X-Plex-Content-Compressed-Length: + description: Length of the compressed content + schema: + type: integer + format: int32 + example: 92483 + Content-Length: + description: Length of the response content + schema: + type: integer + format: int32 + example: 92483 + Cache-Control: + description: Cache control directives + schema: + type: string + example: max-age=259200 + Date: + description: Date and time the response was generated + schema: + type: string + format: date-time + example: 'Tue, 03 Sep 2024 10:48:05 GMT' + content: + image/jpeg: + schema: + type: string + format: binary '/library/metadata/{ratingKey}/children': get: tags: @@ -8787,8 +8985,8 @@ paths: servers: - url: 'https://plex.tv/api/v2' tags: - - Plex - summary: Get UserData By Token + - Authentication + summary: Get User Data By Token description: Get the User data from the provided X-Plex-Token operationId: getUserDetails responses: diff --git a/src/parameters/image/height.yaml b/src/parameters/image/height.yaml new file mode 100644 index 00000000..65c269a4 --- /dev/null +++ b/src/parameters/image/height.yaml @@ -0,0 +1,6 @@ +name: height +in: query +required: true +schema: + type: integer + example: 396 diff --git a/src/parameters/image/min-size.yaml b/src/parameters/image/min-size.yaml new file mode 100644 index 00000000..2d634e7b --- /dev/null +++ b/src/parameters/image/min-size.yaml @@ -0,0 +1,6 @@ +name: minSize +in: query +required: true +schema: + type: integer + example: 1 diff --git a/src/parameters/image/upscale.yaml b/src/parameters/image/upscale.yaml new file mode 100644 index 00000000..e096910d --- /dev/null +++ b/src/parameters/image/upscale.yaml @@ -0,0 +1,6 @@ +name: upscale +in: query +required: true +schema: + type: integer + example: 1 diff --git a/src/parameters/image/width.yaml b/src/parameters/image/width.yaml new file mode 100644 index 00000000..478e7902 --- /dev/null +++ b/src/parameters/image/width.yaml @@ -0,0 +1,6 @@ +name: width +in: query +required: true +schema: + type: integer + example: 396 diff --git a/src/parameters/library/rating-key.yaml b/src/parameters/library/rating-key.yaml new file mode 100644 index 00000000..233a2c45 --- /dev/null +++ b/src/parameters/library/rating-key.yaml @@ -0,0 +1,8 @@ +name: ratingKey +in: path +description: the id of the library item to return the children of. +schema: + type: integer + example: 9518 +required: true + diff --git a/src/paths/library/metadata/[ratingKey]/banner/get-banner-image.yaml b/src/paths/library/metadata/[ratingKey]/banner/get-banner-image.yaml new file mode 100644 index 00000000..36396ede --- /dev/null +++ b/src/paths/library/metadata/[ratingKey]/banner/get-banner-image.yaml @@ -0,0 +1,79 @@ +get: + summary: Get Banner Image + description: Gets the banner image of the media item + operationId: get-banner-image + parameters: + - name: ratingKey + in: path + description: the id of the library item to return the children of. + schema: + type: integer + example: 9518 + required: true + - $ref: "../../../../../parameters/image/width.yaml" + - $ref: "../../../../../parameters/image/height.yaml" + - $ref: "../../../../../parameters/image/min-size.yaml" + - $ref: "../../../../../parameters/image/upscale.yaml" + responses: + '200': + description: Successful response returning an image + headers: + X-Plex-Protocol: + description: Version of the Plex protocol + schema: + type: string + example: "1.0" + Content-Type: + description: The MIME type of the returned content + schema: + type: string + example: "image/jpeg" + Connection: + description: Connection type + schema: + type: string + example: "Keep-Alive" + Keep-Alive: + description: Keep-Alive header with timeout value + schema: + type: string + example: "timeout=20" + Content-Encoding: + description: Content encoding method + schema: + type: string + example: "gzip" + X-Plex-Content-Original-Length: + description: Original length of the uncompressed content + schema: + type: integer + format: int32 + example: 92476 + X-Plex-Content-Compressed-Length: + description: Length of the compressed content + schema: + type: integer + format: int32 + example: 92483 + Content-Length: + description: Length of the response content + schema: + type: integer + format: int32 + example: 92483 + Cache-Control: + description: Cache control directives + schema: + type: string + example: "max-age=259200" + Date: + description: Date and time the response was generated + schema: + type: string + format: date-time + example: "Tue, 03 Sep 2024 10:48:05 GMT" + content: + image/jpeg: + schema: + type: string + format: binary diff --git a/src/paths/library/metadata.yaml b/src/paths/library/metadata/[ratingKey]/get-meta-data-by-rating-key.yaml similarity index 98% rename from src/paths/library/metadata.yaml rename to src/paths/library/metadata/[ratingKey]/get-meta-data-by-rating-key.yaml index 4cd5b174..f638c29b 100644 --- a/src/paths/library/metadata.yaml +++ b/src/paths/library/metadata/[ratingKey]/get-meta-data-by-rating-key.yaml @@ -1,20 +1,18 @@ get: tags: - Library - summary: Get Items Metadata + summary: Get Metadata by RatingKey description: | This endpoint will return the metadata of a library item specified with the ratingKey. - operationId: getMetadata + operationId: get-meta-data-by-rating-key parameters: - name: ratingKey - description: the id of the library item to return the children of. in: path + description: the id of the library item to return the children of. schema: - type: number + type: integer + example: 9518 required: true - examples: - rating-key: - value: 17 responses: "200": description: The metadata of the library item. @@ -91,8 +89,7 @@ get: example: PG-13 summary: type: string - example: - Serenity continues the story of the TV series it was based upon + example: Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered @@ -496,6 +493,6 @@ get: type: string example: https://metadata-static.plex.tv/8/people/87877371326a964634d18556d94547e1.jpg "400": - $ref: "../../responses/400.yaml" + $ref: "../../../../responses/400.yaml" "401": - $ref: "../../responses/401.yaml" + $ref: "../../../../responses/401.yaml" diff --git a/src/paths/library/metadata/[ratingKey]/thumb/get-thumb-image.yaml b/src/paths/library/metadata/[ratingKey]/thumb/get-thumb-image.yaml new file mode 100644 index 00000000..63d610b1 --- /dev/null +++ b/src/paths/library/metadata/[ratingKey]/thumb/get-thumb-image.yaml @@ -0,0 +1,79 @@ +get: + summary: Get Banner Image + description: Gets the banner image of the media item + operationId: get-thumb-image + parameters: + - name: ratingKey + in: path + description: the id of the library item to return the children of. + schema: + type: integer + example: 9518 + required: true + - $ref: "../../../../../parameters/image/width.yaml" + - $ref: "../../../../../parameters/image/height.yaml" + - $ref: "../../../../../parameters/image/min-size.yaml" + - $ref: "../../../../../parameters/image/upscale.yaml" + responses: + '200': + description: Successful response returning an image + headers: + X-Plex-Protocol: + description: Version of the Plex protocol + schema: + type: string + example: "1.0" + Content-Type: + description: The MIME type of the returned content + schema: + type: string + example: "image/jpeg" + Connection: + description: Connection type + schema: + type: string + example: "Keep-Alive" + Keep-Alive: + description: Keep-Alive header with timeout value + schema: + type: string + example: "timeout=20" + Content-Encoding: + description: Content encoding method + schema: + type: string + example: "gzip" + X-Plex-Content-Original-Length: + description: Original length of the uncompressed content + schema: + type: integer + format: int32 + example: 92476 + X-Plex-Content-Compressed-Length: + description: Length of the compressed content + schema: + type: integer + format: int32 + example: 92483 + Content-Length: + description: Length of the response content + schema: + type: integer + format: int32 + example: 92483 + Cache-Control: + description: Cache control directives + schema: + type: string + example: "max-age=259200" + Date: + description: Date and time the response was generated + schema: + type: string + format: date-time + example: "Tue, 03 Sep 2024 10:48:05 GMT" + content: + image/jpeg: + schema: + type: string + format: binary diff --git a/src/paths/user/user.yaml b/src/paths/user/get-user-data-by-token.yaml similarity index 90% rename from src/paths/user/user.yaml rename to src/paths/user/get-user-data-by-token.yaml index 9838556d..dffc18f7 100644 --- a/src/paths/user/user.yaml +++ b/src/paths/user/get-user-data-by-token.yaml @@ -2,8 +2,8 @@ get: servers: - url: 'https://plex.tv/api/v2' tags: - - User - summary: Get UserData By Token + - Authentication + summary: Get User Data By Token description: Get the User data from the provided X-Plex-Token operationId: getUserDetails parameters: diff --git a/src/pms-spec.yaml b/src/pms-spec.yaml index 19e459e1..733d947b 100644 --- a/src/pms-spec.yaml +++ b/src/pms-spec.yaml @@ -129,8 +129,13 @@ paths: $ref: "./paths/library/[sectionId]/refresh/get-refresh-library-metadata.yaml" /library/sections/{sectionId}/search: $ref: "./paths/library/[sectionId]/get-search-library.yaml" + /library/metadata/{ratingKey}: - $ref: "./paths/library/metadata.yaml" + $ref: "./paths/library/metadata/[ratingKey]/get-meta-data-by-rating-key.yaml" + /library/metadata/{ratingKey}/banner: + $ref: "./paths/library/metadata/[ratingKey]/banner/get-banner-image.yaml" + /library/metadata/{ratingKey}/thumb: + $ref: "./paths/library/metadata/[ratingKey]/thumb/get-thumb-image.yaml" /library/metadata/{ratingKey}/children: $ref: "./paths/library/metadata-children.yaml" /library/all/top: @@ -217,7 +222,7 @@ paths: # User /user: - $ref: "./paths/user/user.yaml" + $ref: "./paths/user/get-user-data-by-token.yaml" /users/signin: $ref: "./paths/users/post-sign-in.yaml"