added thumb and banner image endpoint

This commit is contained in:
JasonLandbridge
2024-09-03 14:13:32 +02:00
parent b2f43e3920
commit 4e44fd3e77
11 changed files with 416 additions and 26 deletions

View File

@@ -3404,7 +3404,7 @@ paths:
tags: tags:
- Library - Library
summary: Search Library summary: Search Library
operationId: searchLibrary operationId: get-search-library
description: | description: |
Search for content within a specific section of the library. Search for content within a specific section of the library.
@@ -3589,20 +3589,18 @@ paths:
get: get:
tags: tags:
- Library - Library
summary: Get Items Metadata summary: Get Metadata by RatingKey
description: | description: |
This endpoint will return the metadata of a library item specified with the ratingKey. This endpoint will return the metadata of a library item specified with the ratingKey.
operationId: getMetadata operationId: get-meta-data-by-rating-key
parameters: parameters:
- name: ratingKey - name: ratingKey
description: the id of the library item to return the children of.
in: path in: path
schema: description: the id of the library item to return the children of.
type: number schema: null
type: integer
example: 9518
required: true required: true
examples:
rating-key:
value: 17
responses: responses:
'200': '200':
description: The metadata of the library item. description: The metadata of the library item.
@@ -4101,6 +4099,206 @@ paths:
status: status:
type: number type: number
example: 401 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': '/library/metadata/{ratingKey}/children':
get: get:
tags: tags:
@@ -8787,8 +8985,8 @@ paths:
servers: servers:
- url: 'https://plex.tv/api/v2' - url: 'https://plex.tv/api/v2'
tags: tags:
- Plex - Authentication
summary: Get UserData By Token summary: Get User Data By Token
description: Get the User data from the provided X-Plex-Token description: Get the User data from the provided X-Plex-Token
operationId: getUserDetails operationId: getUserDetails
responses: responses:

View File

@@ -0,0 +1,6 @@
name: height
in: query
required: true
schema:
type: integer
example: 396

View File

@@ -0,0 +1,6 @@
name: minSize
in: query
required: true
schema:
type: integer
example: 1

View File

@@ -0,0 +1,6 @@
name: upscale
in: query
required: true
schema:
type: integer
example: 1

View File

@@ -0,0 +1,6 @@
name: width
in: query
required: true
schema:
type: integer
example: 396

View File

@@ -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

View File

@@ -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

View File

@@ -1,20 +1,18 @@
get: get:
tags: tags:
- Library - Library
summary: Get Items Metadata summary: Get Metadata by RatingKey
description: | description: |
This endpoint will return the metadata of a library item specified with the ratingKey. This endpoint will return the metadata of a library item specified with the ratingKey.
operationId: getMetadata operationId: get-meta-data-by-rating-key
parameters: parameters:
- name: ratingKey - name: ratingKey
description: the id of the library item to return the children of.
in: path in: path
description: the id of the library item to return the children of.
schema: schema:
type: number type: integer
example: 9518
required: true required: true
examples:
rating-key:
value: 17
responses: responses:
"200": "200":
description: The metadata of the library item. description: The metadata of the library item.
@@ -91,8 +89,7 @@ get:
example: PG-13 example: PG-13
summary: summary:
type: string type: string
example: example: Serenity continues the story of the TV series it was based upon
Serenity continues the story of the TV series it was based upon
("Firefly"). River Tam had a secret - one in which she's not ("Firefly"). River Tam had a secret - one in which she's not
even aware - so dangerous, no one's safe, as an Alliance even aware - so dangerous, no one's safe, as an Alliance
operative's sent to capture her, and all others are considered operative's sent to capture her, and all others are considered
@@ -496,6 +493,6 @@ get:
type: string type: string
example: https://metadata-static.plex.tv/8/people/87877371326a964634d18556d94547e1.jpg example: https://metadata-static.plex.tv/8/people/87877371326a964634d18556d94547e1.jpg
"400": "400":
$ref: "../../responses/400.yaml" $ref: "../../../../responses/400.yaml"
"401": "401":
$ref: "../../responses/401.yaml" $ref: "../../../../responses/401.yaml"

View File

@@ -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

View File

@@ -2,8 +2,8 @@ get:
servers: servers:
- url: 'https://plex.tv/api/v2' - url: 'https://plex.tv/api/v2'
tags: tags:
- User - Authentication
summary: Get UserData By Token summary: Get User Data By Token
description: Get the User data from the provided X-Plex-Token description: Get the User data from the provided X-Plex-Token
operationId: getUserDetails operationId: getUserDetails
parameters: parameters:

View File

@@ -129,8 +129,13 @@ paths:
$ref: "./paths/library/[sectionId]/refresh/get-refresh-library-metadata.yaml" $ref: "./paths/library/[sectionId]/refresh/get-refresh-library-metadata.yaml"
/library/sections/{sectionId}/search: /library/sections/{sectionId}/search:
$ref: "./paths/library/[sectionId]/get-search-library.yaml" $ref: "./paths/library/[sectionId]/get-search-library.yaml"
/library/metadata/{ratingKey}: /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: /library/metadata/{ratingKey}/children:
$ref: "./paths/library/metadata-children.yaml" $ref: "./paths/library/metadata-children.yaml"
/library/all/top: /library/all/top:
@@ -217,7 +222,7 @@ paths:
# User # User
/user: /user:
$ref: "./paths/user/user.yaml" $ref: "./paths/user/get-user-data-by-token.yaml"
/users/signin: /users/signin:
$ref: "./paths/users/post-sign-in.yaml" $ref: "./paths/users/post-sign-in.yaml"