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:
- 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,7 +8985,7 @@ paths:
servers:
- url: 'https://plex.tv/api/v2'
tags:
- Plex
- Authentication
summary: Get User Data By Token
description: Get the User data from the provided X-Plex-Token
operationId: getUserDetails

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:
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"

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,7 +2,7 @@ get:
servers:
- url: 'https://plex.tv/api/v2'
tags:
- User
- Authentication
summary: Get User Data By Token
description: Get the User data from the provided X-Plex-Token
operationId: getUserDetails

View File

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