Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added test and fixes for get-library-all corrected get-media-meta-data response #85

Merged
merged 2 commits into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 70 additions & 19 deletions src/models/Media-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ items:
type: object
required:
- id
- duration
- bitrate
- width
- height
- aspectRatio
- audioChannels
- audioCodec
- videoCodec
- videoResolution
- container
- videoFrameRate
- videoProfile
- hasVoiceActivity
- Part
properties:
Expand All @@ -25,20 +13,24 @@ items:
example: 387322
duration:
type: integer
format: int32
description: "Duration of the media in milliseconds."
example: 9610350
bitrate:
type: integer
format: int32
description: "Bitrate in bits per second."
example: 25512
width:
type: integer
description: "Video width in pixels."
example: 3840
format: int32
height:
type: integer
description: "Video height in pixels."
example: 1602
format: int32
aspectRatio:
type: number
format: float
Expand All @@ -48,6 +40,11 @@ items:
type: integer
description: "Number of audio channels."
example: 6
format: int32
displayOffset:
type: integer
format: int32
example: 50
audioCodec:
type: string
description: "Audio codec used."
Expand All @@ -66,7 +63,8 @@ items:
example: "mkv"
videoFrameRate:
type: string
description: "Frame rate of the video (e.g., 24p)."
description: |
Frame rate of the video. Values found include NTSC, PAL, 24p
example: "24p"
videoProfile:
type: string
Expand All @@ -76,6 +74,21 @@ items:
type: boolean
description: "Indicates whether voice activity is detected."
example: false
audioProfile:
type: string
description: "The audio profile used for the media (e.g., DTS, Dolby Digital, etc.)."
example: "dts"
optimizedForStreaming:
description: "Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true"
oneOf:
- type: integer
format: int32
enum: [0, 1]
- type: boolean
enum: [true, false]
has64bitOffsets:
type: boolean
example: false
Part:
type: array
description: "An array of parts for this media item."
Expand All @@ -84,12 +97,8 @@ items:
required:
- id
- key
- duration
- file
- size
- container
- videoProfile
- Stream
properties:
accessible:
type: boolean
Expand All @@ -112,16 +121,21 @@ items:
example: "sd"
duration:
type: integer
format: int32
description: "Duration of the part in milliseconds."
example: 9610350
file:
type: string
description: "File path for the part."
example: "/mnt/Movies_1/W/Wicked (2024).mkv"
size:
type: integer
description: "File size in bytes."
type: integer
example: 30649952104
packetLength:
type: integer
format: int32
example: 188
container:
type: string
description: "Container format of the part."
Expand All @@ -130,6 +144,25 @@ items:
type: string
description: "Video profile for the part."
example: "main 10"
audioProfile:
type: string
description: "The audio profile used for the media (e.g., DTS, Dolby Digital, etc.)."
example: "dts"
has64bitOffsets:
type: boolean
example: false
optimizedForStreaming:
description: "Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true"
oneOf:
- type: integer
format: int32
enum: [0, 1]
- type: boolean
enum: [true, false]
hasThumbnail:
allOf:
- description: "Indicates if the part has a thumbnail."
- $ref: "../models/common/PlexBooleanString.yaml"
Stream:
type: array
description: "An array of streams for this part."
Expand All @@ -140,7 +173,6 @@ items:
- streamType
- codec
- index
- bitrate
- language
- languageTag
- languageCode
Expand All @@ -153,6 +185,7 @@ items:
example: 1002625
streamType:
type: integer
format: int32
description: "Stream type (1=video, 2=audio, 3=subtitle)."
example: 1
default:
Expand All @@ -165,10 +198,12 @@ items:
example: "hevc"
index:
type: integer
format: int32
description: "Index of the stream."
example: 0
bitrate:
type: integer
format: int32
description: "Bitrate of the stream."
example: 24743
language:
Expand All @@ -183,8 +218,13 @@ items:
type: string
description: "ISO language code."
example: "eng"
headerCompression:
type: boolean
description: "Indicates whether header compression is enabled."
example: true
DOVIBLCompatID:
type: integer
format: int32
description: "Dolby Vision BL compatibility ID."
example: 1
DOVIBLPresent:
Expand All @@ -197,6 +237,7 @@ items:
example: false
DOVILevel:
type: integer
format: int32
description: "Dolby Vision level."
example: 6
DOVIPresent:
Expand All @@ -205,6 +246,7 @@ items:
example: true
DOVIProfile:
type: integer
format: int32
description: "Dolby Vision profile."
example: 8
DOVIRPUPresent:
Expand All @@ -217,6 +259,7 @@ items:
example: "1.0"
bitDepth:
type: integer
format: int32
description: "Bit depth of the video stream."
example: 10
chromaLocation:
Expand All @@ -229,10 +272,12 @@ items:
example: "4:2:0"
codedHeight:
type: integer
format: int32
description: "Coded video height."
example: 1608
codedWidth:
type: integer
format: int32
description: "Coded video width."
example: 3840
colorPrimaries:
Expand All @@ -258,10 +303,12 @@ items:
example: 23.976
height:
type: integer
format: int32
description: "Height of the video stream."
example: 1602
level:
type: integer
format: int32
description: "Video level."
example: 150
original:
Expand All @@ -280,10 +327,12 @@ items:
example: "progressive"
refFrames:
type: integer
format: int32
description: "Number of reference frames."
example: 1
width:
type: integer
format: int32
description: "Width of the video stream."
example: 3840
displayTitle:
Expand All @@ -303,6 +352,7 @@ items:
example: true
channels:
type: integer
format: int32
description: "Number of audio channels (for audio streams)."
example: 6
audioChannelLayout:
Expand All @@ -311,6 +361,7 @@ items:
example: "5.1(side)"
samplingRate:
type: integer
format: int32
description: "Sampling rate for the audio stream."
example: 48000
canAutoSync:
Expand Down
2 changes: 1 addition & 1 deletion src/models/MediaContainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ required:
- size
properties:
size:
type: number
type: integer
example: 50
offset:
type: integer
Expand Down
9 changes: 8 additions & 1 deletion src/models/Meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ properties:
example: "/library/sections/2/all?type=2"
type:
type: string
example: "show"
example: filter
subtype:
type: string
example: "clip"
title:
type: string
example: "TV Shows"
Expand Down Expand Up @@ -50,6 +53,10 @@ properties:
type:
type: string
example: "filter"
advanced:
type: boolean
example: true

Sort:
type: array
items:
Expand Down
8 changes: 8 additions & 0 deletions src/models/collection/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
required:
- tag
properties:
tag:
type: string
description: The user made collection this media item belongs too
example: My Awesome Collection
4 changes: 4 additions & 0 deletions src/models/common/PlexMediaTypeString.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ enum:
- show
- season
- episode
- artist
- album
example: "movie"
description: |
The type of media content
Expand All @@ -12,3 +14,5 @@ x-speakeasy-enums:
- TV_SHOW
- SEASON
- EPISODE
- ARTIST
- ALBUM
8 changes: 8 additions & 0 deletions src/models/country/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
required:
- tag
properties:
tag:
type: string
description: The country of origin of this media item
example: United States of America
8 changes: 8 additions & 0 deletions src/models/director/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
required:
- tag
properties:
tag:
type: string
description: The role of Director
example: Danny Boyle
9 changes: 9 additions & 0 deletions src/models/genre/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
required:
- tag
properties:
tag:
type: string
description: |
The genre name of this media-item
example: "Crime"
8 changes: 8 additions & 0 deletions src/models/media-container/content.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
required:
- content
properties:
content:
type: string
description: "The content type or mode."
example: "secondary"
8 changes: 8 additions & 0 deletions src/models/media-container/offset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
required:
- offset
properties:
offset:
type: integer
description: "Offset value for pagination."
example: 0
Comment on lines +1 to +8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

My dear, I must commend the splendid introduction of the offset schema. The definition is both concise and precise—with the required "offset" property, its type declared as an integer and an example provided to guide future implementers. Might I humbly suggest that, should further constraints (such as a maximum allowable offset) become pertinent, one may wish to include such validations in a future revision?

4 changes: 3 additions & 1 deletion src/models/media-container/size.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ required:
- size
properties:
size:
type: number
description: "Number of media items returned in this response."
type: integer
format: int32
example: 50
9 changes: 9 additions & 0 deletions src/models/media-container/total-size.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
required:
- totalSize
properties:
totalSize:
description: "Total number of media items in the library."
type: integer
format: int32
example: 50
Loading
Loading