added a new search all libraries endpoint with tests

This commit is contained in:
JasonLandbridge
2024-09-30 16:05:45 +02:00
parent d4fbc74edb
commit 18374e4b11
7 changed files with 36066 additions and 675 deletions

View File

@@ -1,7 +1,5 @@
type: array
items:
type: object
required:
type: object
required:
- ratingKey
- key
- guid
@@ -9,7 +7,7 @@ items:
- type
- addedAt
- summary
properties:
properties:
ratingKey:
type: string
example: "58683"
@@ -165,18 +163,7 @@ items:
type: object
required:
- id
- duration
- bitrate
- width
- height
- aspectRatio
- audioChannels
- audioCodec
- videoCodec
- videoResolution
- container
- videoFrameRate
- videoProfile
- Part
properties:
id:
@@ -243,11 +230,9 @@ items:
required:
- id
- key
- duration
- file
- size
- container
- videoProfile
properties:
id:
type: integer
@@ -517,6 +502,14 @@ items:
type: string
description: The role of the actor or tag in the media.
example: "Self"
Location:
type: array
items:
type: object
properties:
path:
type: string
example: "/TV Shows/House"
Guid:
x-speakeasy-name-override: MediaGuid
description: |

View File

@@ -0,0 +1,6 @@
name: query
in: query
required: true
schema:
type: string
description: The search query term.

View File

@@ -39,6 +39,8 @@ get:
Meta:
$ref: "../../../models/Meta.yaml"
Metadata:
type: array
items:
$ref: "../../../models/MetaData.yaml"
"401":

View File

@@ -171,6 +171,8 @@ get:
type: boolean
example: true
Metadata:
type: array
items:
$ref: "../../../models/MetaData.yaml"
Meta:
description: |

View File

@@ -0,0 +1,81 @@
get:
tags:
- Library
summary: Search All Libraries
operationId: get-search-all-libraries
description: |
Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.
parameters:
- $ref: "../../parameters/query.yaml"
- $ref: "../../parameters/plex/x-plex-identifier.yaml"
- name: limit
in: query
required: false
schema:
type: integer
description: Limit the number of results returned.
- name: searchTypes
in: query
required: false
schema:
type: array
items:
type: string
enum:
- movies
- music
- otherVideos
- people
- tv
example: movies,music,otherVideos,people,tv
style: form
explode: false
description: |
A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
- name: includeCollections
in: query
required: false
schema:
$ref: "../../models/common/PlexBoolean.yaml"
description: Whether to include collections in the search results.
- name: includeExternalMedia
in: query
required: false
schema:
$ref: "../../models/common/PlexBoolean.yaml"
description: Whether to include external media in the search results.
responses:
"200":
description: The libraries available on the Server
content:
application/json:
schema:
type: object
required:
- MediaContainer
properties:
MediaContainer:
type: object
required:
- size
- SearchResult
properties:
size:
type: number
SearchResult:
type: array
items:
type: object
required:
- score
- Metadata
properties:
score:
type: number
format: float # This is correct for 32-bit floating-point numbers
Metadata:
$ref: "../../models/MetaData.yaml"
"400":
$ref: "../../responses/400.yaml"
"401":
$ref: "../../responses/401.yaml"

View File

@@ -179,6 +179,9 @@ paths:
/library/sections/{sectionKey}/search:
$ref: "./paths/library/[sectionKey]/get-search-library.yaml"
/library/search:
$ref: "./paths/library/get-search-all-libraries.yaml"
/library/metadata/{ratingKey}:
$ref: "./paths/library/metadata/[ratingKey]/get-meta-data-by-rating-key.yaml"
/library/metadata/{ratingKey}/banner:

File diff suppressed because it is too large Load Diff