diff --git a/.gitignore b/.gitignore
index 9cc67a76..68c1a855 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+/mcp-server
+/bin
/.eslintcache
/.speakeasy/reports
/react-query
diff --git a/.npmignore b/.npmignore
index 7e54c532..cf98a6bf 100644
--- a/.npmignore
+++ b/.npmignore
@@ -4,6 +4,7 @@
!/REACT_QUERY.md
!/**/*.ts
!/**/*.js
+!/**/*.mjs
!/**/*.json
!/**/*.map
diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock
index 37afae65..55ba3cb8 100755
--- a/.speakeasy/gen.lock
+++ b/.speakeasy/gen.lock
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 16f22cbf-f23f-4419-8924-3a4b06381947
management:
- docChecksum: db70208972d147ac1e404cbc688f565d
+ docChecksum: 132b4d89494288c532b0f091056aaf1a
docVersion: 0.0.3
- speakeasyVersion: 1.487.1
- generationVersion: 2.506.0
- releaseVersion: 0.34.0
- configChecksum: ddd9eab813b869dba044072499dd8464
+ speakeasyVersion: 1.513.2
+ generationVersion: 2.545.2
+ releaseVersion: 0.35.0
+ configChecksum: 0a23b4efb8e77047876d90a225bb617d
repoURL: https://github.com/LukeHagar/plexjs.git
repoSubDirectory: .
installationURL: https://github.com/LukeHagar/plexjs
@@ -15,7 +15,7 @@ features:
typescript:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.11
- core: 3.19.0
+ core: 3.21.3
defaultEnabledRetries: 0.1.0
deprecations: 2.81.1
downloadStreams: 0.1.1
@@ -24,13 +24,13 @@ features:
envVarSecurityUsage: 0.1.2
errors: 2.84.0
flattening: 2.82.1
- globalSecurity: 2.82.12
+ globalSecurity: 2.82.13
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
globalServerURLs: 2.82.4
methodServerURLs: 2.82.1
nameOverrides: 2.81.2
- nullables: 0.1.0
+ nullables: 0.1.1
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.2.0
@@ -1250,6 +1250,7 @@ generatedFiles:
- src/sdk/server.ts
- src/sdk/sessions.ts
- src/sdk/statistics.ts
+ - src/sdk/types/async.ts
- src/sdk/types/blobs.ts
- src/sdk/types/constdatetime.ts
- src/sdk/types/enums.ts
@@ -1632,7 +1633,7 @@ examples:
X-Plex-Container-Size: 50
responses:
"200":
- application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "filter", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}, {"type": "tag", "Operator": []}]}, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}, {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": []}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}]}}
+ application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "allowSync": false, "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "filter", "subtype": "clip", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "subtype": "clip", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "subtype": "clip", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}, {"type": "tag", "Operator": []}]}, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}, {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": []}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}]}}
getLibraryHubs:
speakeasy-default-get-library-hubs:
parameters:
@@ -1703,7 +1704,7 @@ examples:
X-Plex-Container-Size: 50
responses:
"200":
- application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "filter", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}], "size": 50, "identifier": "com.plexapp.plugins.library", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1680021154, "Metadata": [{"librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "ratingKey": 59398, "key": "/library/metadata/59398", "guid": "plex://movie/5e161a83bea6ac004126e148", "studio": "Marvel Studios", "type": "movie", "title": "Ant-Man and the Wasp: Quantumania", "contentRating": "PG-13", "summary": "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", "rating": 4.7, "audienceRating": 8.3, "year": 2023, "tagline": "Witness the beginning of a new dynasty.", "thumb": "/library/metadata/59398/thumb/1681888010", "art": "/library/metadata/59398/art/1681888010", "duration": 7474422, "originallyAvailableAt": "2023-02-15T00:00:00Z", "addedAt": 1681803215, "updatedAt": 1681888010, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/59399", "ratingImage": "rottentomatoes://image.rating.rotten", "Media": [{"id": 120345, "duration": 7474422, "bitrate": 3623, "width": 1920, "height": 804, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "ac3", "videoCodec": "h264", "videoResolution": 1080, "container": "mp4", "videoFrameRate": "24p", "optimizedForStreaming": 0, "videoProfile": "high", "Part": [{"id": 120353, "key": "/library/parts/120353/1681803203/file.mp4", "duration": 7474422, "file": "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", "size": 3395307162, "container": "mp4", "hasThumbnail": 1, "videoProfile": "high"}]}], "Genre": [{"tag": "Comedy"}], "Director": [{"tag": "Peyton Reed"}], "Writer": [{"tag": "Jeff Loveness"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}, {"tag": "United States of America"}], "Role": [{"tag": "Paul Rudd"}]}]}}
+ application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "filter", "subtype": "clip", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "subtype": "clip", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}], "size": 50, "identifier": "com.plexapp.plugins.library", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1680021154, "Metadata": [{"librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "ratingKey": 59398, "key": "/library/metadata/59398", "guid": "plex://movie/5e161a83bea6ac004126e148", "studio": "Marvel Studios", "type": "movie", "title": "Ant-Man and the Wasp: Quantumania", "contentRating": "PG-13", "summary": "Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible.", "rating": 4.7, "audienceRating": 8.3, "year": 2023, "tagline": "Witness the beginning of a new dynasty.", "thumb": "/library/metadata/59398/thumb/1681888010", "art": "/library/metadata/59398/art/1681888010", "duration": 7474422, "originallyAvailableAt": "2023-02-15T00:00:00Z", "addedAt": 1681803215, "updatedAt": 1681888010, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/59399", "ratingImage": "rottentomatoes://image.rating.rotten", "Media": [{"id": 120345, "duration": 7474422, "bitrate": 3623, "width": 1920, "height": 804, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "ac3", "videoCodec": "h264", "videoResolution": 1080, "container": "mp4", "videoFrameRate": "24p", "optimizedForStreaming": 0, "videoProfile": "high", "Part": [{"id": 120353, "key": "/library/parts/120353/1681803203/file.mp4", "duration": 7474422, "file": "/movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4", "size": 3395307162, "container": "mp4", "hasThumbnail": 1, "videoProfile": "high"}]}], "Genre": [{"tag": "Comedy"}], "Director": [{"tag": "Peyton Reed"}], "Writer": [{"tag": "Jeff Loveness"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}, {"tag": "United States of America"}], "Role": [{"tag": "Paul Rudd"}]}]}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
@@ -1755,7 +1756,7 @@ examples:
X-Plex-Container-Size: 50
responses:
"200":
- application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "filter", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}], "size": 70, "totalSize": 170, "offset": 0, "content": "secondary", "allowSync": true, "nocache": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1701731894, "thumb": "/:/resources/movie.png", "title1": "Movies", "title2": "Recently Released", "viewGroup": "movie", "viewMode": 65592, "mixedParents": true, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": []}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}, {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}], "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}]}]}}}
+ application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "filter", "subtype": "clip", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "subtype": "clip", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "filter", "subtype": "clip", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter", "advanced": true}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}], "size": 70, "totalSize": 170, "offset": 0, "content": "secondary", "allowSync": true, "nocache": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1701731894, "thumb": "/:/resources/movie.png", "title1": "Movies", "title2": "Recently Released", "viewGroup": "movie", "viewMode": 65592, "mixedParents": true, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": []}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}, {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "episodeSort": "0", "enableCreditsMarkerGeneration": "-1", "showOrdering": "absolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}, {"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}], "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}, {"type": "tag", "Operator": [{"key": "=", "title": "is"}]}]}}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
@@ -2336,7 +2337,7 @@ examples:
asyncRefreshLocalMediaAgent: true
responses:
"200":
- application/json: {"MediaContainer": {"size": 50, "allowSync": false, "identifier": "com.plexapp.plugins.library", "librarySectionID": 2, "librarySectionTitle": "TV Series", "librarySectionUUID": "e69655a2-ef48-4aba-bb19-0cc34d1e7d36", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "Metadata": [{"ratingKey": "44288", "parentRatingKey": "48047", "grandparentRatingKey": "45520", "parentGuid": "plex://season/618b89208dde18df707ad15c", "grandparentGuid": "plex://show/5e16253691c20300412003a8", "grandparentSlug": "alice-in-borderland-2020", "grandparentKey": "/library/metadata/45520", "parentKey": "/library/metadata/48047", "key": "/library/metadata/44288/children", "guid": "plex://show/5d9c08254eefaa001f5d6dcb", "slug": "better-call-saul", "studio": "Sony Pictures Television", "type": "show", "title": "Better Call Saul", "originalTitle": "Wicked: Part I", "librarySectionTitle": "TV Series ", "librarySectionID": 2, "librarySectionKey": "/library/sections/2", "contentRating": "TV-MA", "summary": "Before Saul Goodman, he was Jimmy McGill. And if you're calling Jimmy, you're in real trouble. The prequel to \"Breaking Bad\" follows small-time attorney, Jimmy McGill, as he transforms into Walter White's morally challenged lawyer, Saul Goodman.", "index": 1, "grandparentTitle": "Alice in Borderland", "parentTitle": "Season 2", "audienceRating": 8.7, "viewCount": 4, "skipCount": 1, "lastViewedAt": 1625764795, "year": 2015, "tagline": "Make the call", "chapterSource": "media", "primaryExtraKey": "/library/metadata/134704", "thumb": "/library/metadata/44288/thumb/1736487993", "art": "/library/metadata/44288/art/1736487993", "theme": "/library/metadata/44288/theme/1736487993", "duration": 2700000, "originallyAvailableAt": "2015-02-08", "leafCount": 63, "viewedLeafCount": 4, "childCount": 6, "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "themoviedb://image.rating", "parentIndex": 2, "parentThumb": "/library/metadata/48047/thumb/1671800243", "grandparentThumb": "/library/metadata/45520/thumb/1736488003", "grandparentArt": "/library/metadata/45520/art/1736488003", "Media": [{"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}, {"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": []}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}, {"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "Part": []}], "Image": [{"alt": "Better Call Saul", "type": "coverPoster", "url": "/library/metadata/44288/thumb/1736487993"}, {"alt": "Better Call Saul", "type": "coverPoster", "url": "/library/metadata/44288/thumb/1736487993"}], "UltraBlurColors": {"topLeft": "11333a", "topRight": "1d2721", "bottomRight": "5c451d", "bottomLeft": "372c10"}, "Genre": [{"id": 1057, "filter": "genre=1057", "tag": "Crime"}], "Country": [{"id": 58591, "filter": "country=58591", "tag": "United States of America"}, {"id": 58591, "filter": "country=58591", "tag": "United States of America"}], "Guid": [{"id": "imdb://tt3032476"}], "Rating": [{"image": "imdb://image.rating", "value": 9, "type": "audience"}], "Role": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Director": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Writer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Producer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Similar": [{"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}, {"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}, {"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}], "Location": [{"path": "/TV Shows/Better Call Saul"}]}, {"ratingKey": "44288", "parentRatingKey": "48047", "grandparentRatingKey": "45520", "parentGuid": "plex://season/618b89208dde18df707ad15c", "grandparentGuid": "plex://show/5e16253691c20300412003a8", "grandparentSlug": "alice-in-borderland-2020", "grandparentKey": "/library/metadata/45520", "parentKey": "/library/metadata/48047", "key": "/library/metadata/44288/children", "guid": "plex://show/5d9c08254eefaa001f5d6dcb", "slug": "better-call-saul", "studio": "Sony Pictures Television", "type": "show", "title": "Better Call Saul", "originalTitle": "Wicked: Part I", "librarySectionTitle": "TV Series ", "librarySectionID": 2, "librarySectionKey": "/library/sections/2", "contentRating": "TV-MA", "summary": "Before Saul Goodman, he was Jimmy McGill. And if you're calling Jimmy, you're in real trouble. The prequel to \"Breaking Bad\" follows small-time attorney, Jimmy McGill, as he transforms into Walter White's morally challenged lawyer, Saul Goodman.", "index": 1, "grandparentTitle": "Alice in Borderland", "parentTitle": "Season 2", "audienceRating": 8.7, "viewCount": 4, "skipCount": 1, "lastViewedAt": 1625764795, "year": 2015, "tagline": "Make the call", "chapterSource": "media", "primaryExtraKey": "/library/metadata/134704", "thumb": "/library/metadata/44288/thumb/1736487993", "art": "/library/metadata/44288/art/1736487993", "theme": "/library/metadata/44288/theme/1736487993", "duration": 2700000, "originallyAvailableAt": "2015-02-08", "leafCount": 63, "viewedLeafCount": 4, "childCount": 6, "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "themoviedb://image.rating", "parentIndex": 2, "parentThumb": "/library/metadata/48047/thumb/1671800243", "grandparentThumb": "/library/metadata/45520/thumb/1736488003", "grandparentArt": "/library/metadata/45520/art/1736488003", "Media": [{"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}, {"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "Part": []}], "Image": [], "UltraBlurColors": {"topLeft": "11333a", "topRight": "1d2721", "bottomRight": "5c451d", "bottomLeft": "372c10"}, "Genre": [{"id": 1057, "filter": "genre=1057", "tag": "Crime"}], "Country": [{"id": 58591, "filter": "country=58591", "tag": "United States of America"}, {"id": 58591, "filter": "country=58591", "tag": "United States of America"}], "Guid": [{"id": "imdb://tt3032476"}, {"id": "imdb://tt3032476"}], "Rating": [], "Role": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Director": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Writer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Producer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Similar": [{"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}, {"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}], "Location": [{"path": "/TV Shows/Better Call Saul"}, {"path": "/TV Shows/Better Call Saul"}]}, {"ratingKey": "44288", "parentRatingKey": "48047", "grandparentRatingKey": "45520", "parentGuid": "plex://season/618b89208dde18df707ad15c", "grandparentGuid": "plex://show/5e16253691c20300412003a8", "grandparentSlug": "alice-in-borderland-2020", "grandparentKey": "/library/metadata/45520", "parentKey": "/library/metadata/48047", "key": "/library/metadata/44288/children", "guid": "plex://show/5d9c08254eefaa001f5d6dcb", "slug": "better-call-saul", "studio": "Sony Pictures Television", "type": "show", "title": "Better Call Saul", "originalTitle": "Wicked: Part I", "librarySectionTitle": "TV Series ", "librarySectionID": 2, "librarySectionKey": "/library/sections/2", "contentRating": "TV-MA", "summary": "Before Saul Goodman, he was Jimmy McGill. And if you're calling Jimmy, you're in real trouble. The prequel to \"Breaking Bad\" follows small-time attorney, Jimmy McGill, as he transforms into Walter White's morally challenged lawyer, Saul Goodman.", "index": 1, "grandparentTitle": "Alice in Borderland", "parentTitle": "Season 2", "audienceRating": 8.7, "viewCount": 4, "skipCount": 1, "lastViewedAt": 1625764795, "year": 2015, "tagline": "Make the call", "chapterSource": "media", "primaryExtraKey": "/library/metadata/134704", "thumb": "/library/metadata/44288/thumb/1736487993", "art": "/library/metadata/44288/art/1736487993", "theme": "/library/metadata/44288/theme/1736487993", "duration": 2700000, "originallyAvailableAt": "2015-02-08", "leafCount": 63, "viewedLeafCount": 4, "childCount": 6, "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "themoviedb://image.rating", "parentIndex": 2, "parentThumb": "/library/metadata/48047/thumb/1671800243", "grandparentThumb": "/library/metadata/45520/thumb/1736488003", "grandparentArt": "/library/metadata/45520/art/1736488003", "Media": [{"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": []}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}, {"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "container": "mkv", "videoProfile": "main 10", "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}], "Image": [{"alt": "Better Call Saul", "type": "coverPoster", "url": "/library/metadata/44288/thumb/1736487993"}], "UltraBlurColors": {"topLeft": "11333a", "topRight": "1d2721", "bottomRight": "5c451d", "bottomLeft": "372c10"}, "Genre": [{"id": 1057, "filter": "genre=1057", "tag": "Crime"}], "Country": [{"id": 58591, "filter": "country=58591", "tag": "United States of America"}, {"id": 58591, "filter": "country=58591", "tag": "United States of America"}], "Guid": [], "Rating": [{"image": "imdb://image.rating", "value": 9, "type": "audience"}, {"image": "imdb://image.rating", "value": 9, "type": "audience"}], "Role": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Director": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Writer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Producer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Similar": [{"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}, {"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}], "Location": [{"path": "/TV Shows/Better Call Saul"}]}]}}
+ application/json: {"MediaContainer": {"size": 50, "allowSync": false, "identifier": "com.plexapp.plugins.library", "librarySectionID": 2, "librarySectionTitle": "TV Series", "librarySectionUUID": "e69655a2-ef48-4aba-bb19-0cc34d1e7d36", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1734362201, "Metadata": [{"ratingKey": "44288", "parentRatingKey": "48047", "grandparentRatingKey": "45520", "parentGuid": "plex://season/618b89208dde18df707ad15c", "grandparentGuid": "plex://show/5e16253691c20300412003a8", "grandparentSlug": "alice-in-borderland-2020", "grandparentKey": "/library/metadata/45520", "parentKey": "/library/metadata/48047", "key": "/library/metadata/44288/children", "guid": "plex://show/5d9c08254eefaa001f5d6dcb", "slug": "better-call-saul", "studio": "Sony Pictures Television", "type": "show", "title": "Better Call Saul", "originalTitle": "Wicked: Part I", "librarySectionTitle": "TV Series ", "librarySectionID": 2, "librarySectionKey": "/library/sections/2", "contentRating": "TV-MA", "summary": "Before Saul Goodman, he was Jimmy McGill. And if you're calling Jimmy, you're in real trouble. The prequel to \"Breaking Bad\" follows small-time attorney, Jimmy McGill, as he transforms into Walter White's morally challenged lawyer, Saul Goodman.", "index": 1, "grandparentTitle": "Alice in Borderland", "parentTitle": "Season 2", "audienceRating": 8.7, "viewCount": 4, "skipCount": 1, "lastViewedAt": 1625764795, "year": 2015, "rating": 6, "ratingImage": "rottentomatoes://image.rating.ripe", "tagline": "Make the call", "chapterSource": "media", "primaryExtraKey": "/library/metadata/134704", "thumb": "/library/metadata/44288/thumb/1736487993", "art": "/library/metadata/44288/art/1736487993", "theme": "/library/metadata/44288/theme/1736487993", "duration": 2700000, "originallyAvailableAt": "2015-02-08", "leafCount": 63, "viewedLeafCount": 4, "childCount": 6, "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "themoviedb://image.rating", "parentIndex": 2, "parentThumb": "/library/metadata/48047/thumb/1671800243", "grandparentThumb": "/library/metadata/45520/thumb/1736488003", "grandparentArt": "/library/metadata/45520/art/1736488003", "Media": [{"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "displayOffset": 50, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "audioProfile": "dts", "has64bitOffsets": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}, {"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "displayOffset": 50, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "audioProfile": "dts", "has64bitOffsets": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": []}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}, {"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "displayOffset": 50, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "audioProfile": "dts", "has64bitOffsets": false, "Part": []}], "Image": [{"alt": "Better Call Saul", "type": "coverPoster", "url": "/library/metadata/44288/thumb/1736487993"}, {"alt": "Better Call Saul", "type": "coverPoster", "url": "/library/metadata/44288/thumb/1736487993"}], "UltraBlurColors": {"topLeft": "11333a", "topRight": "1d2721", "bottomRight": "5c451d", "bottomLeft": "372c10"}, "Genre": [{"id": 1057, "filter": "genre=1057", "tag": "Crime"}], "Country": [{"id": 58591, "filter": "country=58591", "tag": "United States of America"}, {"id": 58591, "filter": "country=58591", "tag": "United States of America"}], "Guid": [{"id": "imdb://tt3032476"}], "Rating": [{"image": "imdb://image.rating", "value": 9, "type": "audience"}], "Role": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Director": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Writer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Producer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Similar": [{"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}, {"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}, {"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}], "Location": [{"path": "/TV Shows/Better Call Saul"}]}, {"ratingKey": "44288", "parentRatingKey": "48047", "grandparentRatingKey": "45520", "parentGuid": "plex://season/618b89208dde18df707ad15c", "grandparentGuid": "plex://show/5e16253691c20300412003a8", "grandparentSlug": "alice-in-borderland-2020", "grandparentKey": "/library/metadata/45520", "parentKey": "/library/metadata/48047", "key": "/library/metadata/44288/children", "guid": "plex://show/5d9c08254eefaa001f5d6dcb", "slug": "better-call-saul", "studio": "Sony Pictures Television", "type": "show", "title": "Better Call Saul", "originalTitle": "Wicked: Part I", "librarySectionTitle": "TV Series ", "librarySectionID": 2, "librarySectionKey": "/library/sections/2", "contentRating": "TV-MA", "summary": "Before Saul Goodman, he was Jimmy McGill. And if you're calling Jimmy, you're in real trouble. The prequel to \"Breaking Bad\" follows small-time attorney, Jimmy McGill, as he transforms into Walter White's morally challenged lawyer, Saul Goodman.", "index": 1, "grandparentTitle": "Alice in Borderland", "parentTitle": "Season 2", "audienceRating": 8.7, "viewCount": 4, "skipCount": 1, "lastViewedAt": 1625764795, "year": 2015, "rating": 6, "ratingImage": "rottentomatoes://image.rating.ripe", "tagline": "Make the call", "chapterSource": "media", "primaryExtraKey": "/library/metadata/134704", "thumb": "/library/metadata/44288/thumb/1736487993", "art": "/library/metadata/44288/art/1736487993", "theme": "/library/metadata/44288/theme/1736487993", "duration": 2700000, "originallyAvailableAt": "2015-02-08", "leafCount": 63, "viewedLeafCount": 4, "childCount": 6, "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "themoviedb://image.rating", "parentIndex": 2, "parentThumb": "/library/metadata/48047/thumb/1671800243", "grandparentThumb": "/library/metadata/45520/thumb/1736488003", "grandparentArt": "/library/metadata/45520/art/1736488003", "Media": [{"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "displayOffset": 50, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "audioProfile": "dts", "has64bitOffsets": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}, {"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "displayOffset": 50, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "audioProfile": "dts", "has64bitOffsets": false, "Part": []}], "Image": [], "UltraBlurColors": {"topLeft": "11333a", "topRight": "1d2721", "bottomRight": "5c451d", "bottomLeft": "372c10"}, "Genre": [{"id": 1057, "filter": "genre=1057", "tag": "Crime"}], "Country": [{"id": 58591, "filter": "country=58591", "tag": "United States of America"}, {"id": 58591, "filter": "country=58591", "tag": "United States of America"}], "Guid": [{"id": "imdb://tt3032476"}, {"id": "imdb://tt3032476"}], "Rating": [], "Role": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Director": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Writer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Producer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Similar": [{"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}, {"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}], "Location": [{"path": "/TV Shows/Better Call Saul"}, {"path": "/TV Shows/Better Call Saul"}]}, {"ratingKey": "44288", "parentRatingKey": "48047", "grandparentRatingKey": "45520", "parentGuid": "plex://season/618b89208dde18df707ad15c", "grandparentGuid": "plex://show/5e16253691c20300412003a8", "grandparentSlug": "alice-in-borderland-2020", "grandparentKey": "/library/metadata/45520", "parentKey": "/library/metadata/48047", "key": "/library/metadata/44288/children", "guid": "plex://show/5d9c08254eefaa001f5d6dcb", "slug": "better-call-saul", "studio": "Sony Pictures Television", "type": "show", "title": "Better Call Saul", "originalTitle": "Wicked: Part I", "librarySectionTitle": "TV Series ", "librarySectionID": 2, "librarySectionKey": "/library/sections/2", "contentRating": "TV-MA", "summary": "Before Saul Goodman, he was Jimmy McGill. And if you're calling Jimmy, you're in real trouble. The prequel to \"Breaking Bad\" follows small-time attorney, Jimmy McGill, as he transforms into Walter White's morally challenged lawyer, Saul Goodman.", "index": 1, "grandparentTitle": "Alice in Borderland", "parentTitle": "Season 2", "audienceRating": 8.7, "viewCount": 4, "skipCount": 1, "lastViewedAt": 1625764795, "year": 2015, "rating": 6, "ratingImage": "rottentomatoes://image.rating.ripe", "tagline": "Make the call", "chapterSource": "media", "primaryExtraKey": "/library/metadata/134704", "thumb": "/library/metadata/44288/thumb/1736487993", "art": "/library/metadata/44288/art/1736487993", "theme": "/library/metadata/44288/theme/1736487993", "duration": 2700000, "originallyAvailableAt": "2015-02-08", "leafCount": 63, "viewedLeafCount": 4, "childCount": 6, "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "themoviedb://image.rating", "parentIndex": 2, "parentThumb": "/library/metadata/48047/thumb/1671800243", "grandparentThumb": "/library/metadata/45520/thumb/1736488003", "grandparentArt": "/library/metadata/45520/art/1736488003", "Media": [{"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "displayOffset": 50, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "audioProfile": "dts", "has64bitOffsets": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": []}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}, {"id": 387322, "duration": 9610350, "bitrate": 25512, "width": 3840, "height": 1602, "aspectRatio": 2.35, "audioChannels": 6, "displayOffset": 50, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "audioProfile": "dts", "has64bitOffsets": false, "Part": [{"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}, {"accessible": true, "exists": true, "id": 418385, "key": "/library/parts/418385/1735864239/file.mkv", "indexes": "sd", "duration": 9610350, "file": "/mnt/Movies_1/W/Wicked (2024).mkv", "size": 30649952104, "packetLength": 188, "container": "mkv", "videoProfile": "main 10", "audioProfile": "dts", "has64bitOffsets": false, "hasThumbnail": "1", "Stream": [{"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}, {"id": 1002625, "streamType": 1, "default": true, "codec": "hevc", "index": 0, "bitrate": 24743, "language": "English", "languageTag": "en", "languageCode": "eng", "headerCompression": true, "DOVIBLCompatID": 1, "DOVIBLPresent": true, "DOVIELPresent": false, "DOVILevel": 6, "DOVIPresent": true, "DOVIProfile": 8, "DOVIRPUPresent": true, "DOVIVersion": "1.0", "bitDepth": 10, "chromaLocation": "topleft", "chromaSubsampling": "4:2:0", "codedHeight": 1608, "codedWidth": 3840, "colorPrimaries": "bt2020", "colorRange": "tv", "colorSpace": "bt2020nc", "colorTrc": "smpte2084", "frameRate": 23.976, "height": 1602, "level": 150, "original": true, "hasScalingMatrix": false, "profile": "main 10", "scanType": "progressive", "refFrames": 1, "width": 3840, "displayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "extendedDisplayTitle": "4K DoVi/HDR10 (HEVC Main 10)", "selected": true, "forced": true, "channels": 6, "audioChannelLayout": "5.1(side)", "samplingRate": 48000, "canAutoSync": false, "hearingImpaired": true, "dub": true, "title": "SDH"}]}]}], "Image": [{"alt": "Better Call Saul", "type": "coverPoster", "url": "/library/metadata/44288/thumb/1736487993"}], "UltraBlurColors": {"topLeft": "11333a", "topRight": "1d2721", "bottomRight": "5c451d", "bottomLeft": "372c10"}, "Genre": [{"id": 1057, "filter": "genre=1057", "tag": "Crime"}], "Country": [{"id": 58591, "filter": "country=58591", "tag": "United States of America"}, {"id": 58591, "filter": "country=58591", "tag": "United States of America"}], "Guid": [], "Rating": [{"image": "imdb://image.rating", "value": 9, "type": "audience"}, {"image": "imdb://image.rating", "value": 9, "type": "audience"}], "Role": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Director": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Writer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Producer": [{"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}, {"id": 109501, "filter": "actor=109501", "tag": "Bob Odenkirk", "tagKey": "5d77683254f42c001f8c3f69", "role": "Jimmy McGill", "thumb": "https://metadata-static.plex.tv/f/people/f2ca7b474cc984efbdd5c503a096285a.jpg"}], "Similar": [{"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}, {"id": 26, "filter": "similar=26", "tag": "Breaking Bad"}], "Location": [{"path": "/TV Shows/Better Call Saul"}]}]}}
"400":
application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]}
"401":
diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml
index 5bf19d93..cb73fb57 100755
--- a/.speakeasy/gen.yaml
+++ b/.speakeasy/gen.yaml
@@ -7,13 +7,15 @@ generation:
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: true
+ nameResolutionFeb2025: false
parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true
+ securityFeb2025: false
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: false
typescript:
- version: 0.34.0
+ version: 0.35.0
additionalDependencies:
dependencies: {}
devDependencies: {}
@@ -23,6 +25,7 @@ typescript:
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
enableCustomCodeRegions: false
+ enableMCPServer: true
enableReactQuery: false
enumFormat: enum
flattenGlobalSecurity: true
@@ -36,6 +39,7 @@ typescript:
shared: sdk/models/shared
webhooks: sdk/models/webhooks
inputModelSuffix: input
+ jsonpath: legacy
maxMethodParams: 4
methodArguments: require-security-and-request
moduleFormat: commonjs
diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock
index a881b293..e36b70a8 100644
--- a/.speakeasy/workflow.lock
+++ b/.speakeasy/workflow.lock
@@ -1,4 +1,4 @@
-speakeasyVersion: 1.487.1
+speakeasyVersion: 1.513.2
sources:
my-source:
sourceNamespace: my-source
@@ -9,20 +9,20 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
- sourceRevisionDigest: sha256:0efb9039972533bf1190dfc1ffb377429a8e486b6299442e732f662c1ffbeca6
- sourceBlobDigest: sha256:038d73166cc9db17f514d511cfe4365ea032f4ebcb247fa86b7aa1bba0e1ab46
+ sourceRevisionDigest: sha256:bf7001af017ce5072c503bfbaf60793f94549163b517489dc53e4f7b685659c0
+ sourceBlobDigest: sha256:ed2b29043c84f32d2efa92a126083fd9a81644a7ce9c6ac86d9aeb3493cbd6f8
tags:
- latest
- - speakeasy-sdk-regen-1739146221
+ - speakeasy-sdk-regen-1741306213
- 0.0.3
targets:
plexjs:
source: plexapi
sourceNamespace: plexapi
- sourceRevisionDigest: sha256:0efb9039972533bf1190dfc1ffb377429a8e486b6299442e732f662c1ffbeca6
- sourceBlobDigest: sha256:038d73166cc9db17f514d511cfe4365ea032f4ebcb247fa86b7aa1bba0e1ab46
+ sourceRevisionDigest: sha256:bf7001af017ce5072c503bfbaf60793f94549163b517489dc53e4f7b685659c0
+ sourceBlobDigest: sha256:ed2b29043c84f32d2efa92a126083fd9a81644a7ce9c6ac86d9aeb3493cbd6f8
codeSamplesNamespace: code-samples-typescript-plexjs
- codeSamplesRevisionDigest: sha256:18095ae1c50f9a506f370f124c16b4b0d5ebe8ec15c006e533371285a7201fb3
+ codeSamplesRevisionDigest: sha256:e9663ecbdaaaaaf3f7ff17e00365dc176eda813f06e83bae125af65c9ab34453
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
diff --git a/README.md b/README.md
index d4b20fdc..a5c32771 100644
--- a/README.md
+++ b/README.md
@@ -344,13 +344,39 @@ In some rare cases, the SDK can fail to get a response from the server or even m
### Server Variables
The default server `{protocol}://{ip}:{port}` contains variables and is set to `https://10.10.10.47:32400` by default. To override default values, the following parameters are available when initializing the SDK client instance:
- * `protocol: models.ServerProtocol`
- * `ip: string`
- * `port: string`
+
+| Variable | Parameter | Supported Values | Default | Description |
+| ---------- | --------------------------------- | -------------------------- | --------------- | ---------------------------------------------- |
+| `protocol` | `protocol: models.ServerProtocol` | - `"http"`
- `"https"` | `"https"` | The protocol to use for the server connection |
+| `ip` | `ip: string` | string | `"10.10.10.47"` | The IP address or hostname of your Plex Server |
+| `port` | `port: string` | string | `"32400"` | The port of your Plex Server |
+
+#### Example
+
+```typescript
+import { PlexAPI } from "@lukehagar/plexjs";
+
+const plexAPI = new PlexAPI({
+ protocol: "https",
+ ip: "e0c3:bcc0:6bac:dccc:c4ec:34b1:ca98:4cb9",
+ port: "40311",
+ accessToken: "",
+});
+
+async function run() {
+ const result = await plexAPI.server.getServerCapabilities();
+
+ // Handle the result
+ console.log(result);
+}
+
+run();
+
+```
### Override Server URL Per-Client
-The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
+The default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
```typescript
import { PlexAPI } from "@lukehagar/plexjs";
diff --git a/RELEASES.md b/RELEASES.md
index 83d87d65..0c9b028d 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1228,4 +1228,14 @@ Based on:
### Generated
- [typescript v0.34.0] .
### Releases
-- [NPM v0.34.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.34.0 - .
\ No newline at end of file
+- [NPM v0.34.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.34.0 - .
+
+## 2025-03-07 00:09:55
+### Changes
+Based on:
+- OpenAPI Doc
+- Speakeasy CLI 1.513.2 (2.545.2) https://github.com/speakeasy-api/speakeasy
+### Generated
+- [typescript v0.35.0] .
+### Releases
+- [NPM v0.35.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.35.0 - .
\ No newline at end of file
diff --git a/codeSamples.yaml b/codeSamples.yaml
index 92c146f8..e9918042 100644
--- a/codeSamples.yaml
+++ b/codeSamples.yaml
@@ -419,7 +419,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: added
+ label: get-recently-added
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Type } from "@lukehagar/plexjs/sdk/models/operations";
@@ -504,7 +504,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: identity
+ label: get-server-identity
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
@@ -563,7 +563,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: data
+ label: get-media-meta-data
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
@@ -598,7 +598,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: image
+ label: get-banner-image
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
@@ -645,7 +645,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: image
+ label: get-thumb-image
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
@@ -692,7 +692,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: library
+ label: get-recently-added-library
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { QueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
@@ -731,7 +731,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: libraries
+ label: get-search-all-libraries
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { SearchTypes } from "@lukehagar/plexjs/sdk/models/operations";
@@ -758,7 +758,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: libraries
+ label: get-all-libraries
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
@@ -778,7 +778,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: list
+ label: get-watch-list
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Filter } from "@lukehagar/plexjs/sdk/models/operations";
@@ -822,7 +822,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: details
+ label: get-library-details
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
@@ -842,7 +842,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: library
+ label: get-actors-library
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetActorsLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
@@ -863,7 +863,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: library
+ label: get-all-media-library
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetAllMediaLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
@@ -887,7 +887,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: library
+ label: get-countries-library
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetCountriesLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
@@ -908,7 +908,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: library
+ label: get-genres-library
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetGenresLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
@@ -929,7 +929,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: metadata
+ label: get-refresh-library-metadata
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { Force } from "@lukehagar/plexjs/sdk/models/operations";
@@ -950,7 +950,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: library
+ label: get-search-library
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetSearchLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/operations";
@@ -971,7 +971,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: items
+ label: get-library-items
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
import { GetLibraryItemsQueryParamType, Tag } from "@lukehagar/plexjs/sdk/models/operations";
@@ -1059,7 +1059,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: providers
+ label: get-media-providers
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
@@ -1365,7 +1365,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: resources
+ label: get-server-resources
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
@@ -1688,7 +1688,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: users
+ label: get-users
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
@@ -1720,7 +1720,7 @@ actions:
update:
x-codeSamples:
- lang: typescript
- label: data
+ label: post-users-sign-in-data
source: |-
import { PlexAPI } from "@lukehagar/plexjs";
diff --git a/docs/sdk/models/operations/gettokendetailsuserplexaccount.md b/docs/sdk/models/operations/gettokendetailsuserplexaccount.md
index 6f13f71b..b3652167 100644
--- a/docs/sdk/models/operations/gettokendetailsuserplexaccount.md
+++ b/docs/sdk/models/operations/gettokendetailsuserplexaccount.md
@@ -104,7 +104,7 @@ let value: GetTokenDetailsUserPlexAccount = {
| `services` | [operations.Services](../../../sdk/models/operations/services.md)[] | :heavy_check_mark: | N/A | |
| `subscription` | [operations.Subscription](../../../sdk/models/operations/subscription.md) | :heavy_check_mark: | If the account’s Plex Pass subscription is active | |
| `subscriptionDescription` | *string* | :heavy_check_mark: | Description of the Plex Pass subscription | |
-| `subscriptions` | [operations.GetTokenDetailsSubscription](../../../sdk/models/operations/gettokendetailssubscription.md)[] | :heavy_check_mark: | N/A | |
+| `subscriptions` | [operations.GetTokenDetailsSubscription](../../../sdk/models/operations/gettokendetailssubscription.md)[] | :heavy_minus_sign: | N/A | |
| `thumb` | *string* | :heavy_check_mark: | URL of the account thumbnail | https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101 |
| `title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | UsernameTitle |
| `twoFactorEnabled` | *boolean* | :heavy_minus_sign: | If two-factor authentication is enabled | |
diff --git a/docs/sdk/models/operations/postuserssignindatauserplexaccount.md b/docs/sdk/models/operations/postuserssignindatauserplexaccount.md
index e31e7fda..1d983e0e 100644
--- a/docs/sdk/models/operations/postuserssignindatauserplexaccount.md
+++ b/docs/sdk/models/operations/postuserssignindatauserplexaccount.md
@@ -123,7 +123,7 @@ let value: PostUsersSignInDataUserPlexAccount = {
| `services` | [operations.PostUsersSignInDataServices](../../../sdk/models/operations/postuserssignindataservices.md)[] | :heavy_check_mark: | N/A | |
| `subscription` | [operations.PostUsersSignInDataSubscription](../../../sdk/models/operations/postuserssignindatasubscription.md) | :heavy_check_mark: | If the account’s Plex Pass subscription is active | |
| `subscriptionDescription` | *string* | :heavy_check_mark: | Description of the Plex Pass subscription | |
-| `subscriptions` | [operations.PostUsersSignInDataAuthenticationSubscription](../../../sdk/models/operations/postuserssignindataauthenticationsubscription.md)[] | :heavy_check_mark: | N/A | |
+| `subscriptions` | [operations.PostUsersSignInDataAuthenticationSubscription](../../../sdk/models/operations/postuserssignindataauthenticationsubscription.md)[] | :heavy_minus_sign: | N/A | |
| `thumb` | *string* | :heavy_check_mark: | URL of the account thumbnail | https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101 |
| `title` | *string* | :heavy_check_mark: | The title of the account (username or friendly name) | UsernameTitle |
| `twoFactorEnabled` | *boolean* | :heavy_minus_sign: | If two-factor authentication is enabled | |
diff --git a/jsr.json b/jsr.json
index 9a2f78eb..3fbbadb8 100644
--- a/jsr.json
+++ b/jsr.json
@@ -2,7 +2,7 @@
{
"name": "@lukehagar/plexjs",
- "version": "0.34.0",
+ "version": "0.35.0",
"exports": {
".": "./src/index.ts",
"./sdk/models/errors": "./src/sdk/models/errors/index.ts",
diff --git a/package-lock.json b/package-lock.json
index e5228c9d..567a579c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@lukehagar/plexjs",
- "version": "0.34.0",
+ "version": "0.35.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@lukehagar/plexjs",
- "version": "0.34.0",
+ "version": "0.35.0",
"devDependencies": {
"@eslint/js": "^9.19.0",
"eslint": "^9.19.0",
diff --git a/package.json b/package.json
index 8a6c6104..04b787bb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@lukehagar/plexjs",
- "version": "0.34.0",
+ "version": "0.35.0",
"author": "LukeHagar",
"main": "./index.js",
"sideEffects": false,
diff --git a/src/funcs/activitiesCancelServerActivities.ts b/src/funcs/activitiesCancelServerActivities.ts
index 4baf9289..cdb59ad5 100644
--- a/src/funcs/activitiesCancelServerActivities.ts
+++ b/src/funcs/activitiesCancelServerActivities.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Cancel Server Activities
*/
-export async function activitiesCancelServerActivities(
+export function activitiesCancelServerActivities(
client: PlexAPICore,
activityUUID: string,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.CancelServerActivitiesResponse,
| errors.CancelServerActivitiesBadRequest
@@ -46,6 +47,34 @@ export async function activitiesCancelServerActivities(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ activityUUID,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ activityUUID: string,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.CancelServerActivitiesResponse,
+ | errors.CancelServerActivitiesBadRequest
+ | errors.CancelServerActivitiesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.CancelServerActivitiesRequest = {
activityUUID: activityUUID,
@@ -58,7 +87,7 @@ export async function activitiesCancelServerActivities(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -81,6 +110,7 @@ export async function activitiesCancelServerActivities(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "cancelServerActivities",
oAuth2Scopes: [],
@@ -103,7 +133,7 @@ export async function activitiesCancelServerActivities(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +144,7 @@ export async function activitiesCancelServerActivities(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -145,8 +175,8 @@ export async function activitiesCancelServerActivities(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/activitiesGetServerActivities.ts b/src/funcs/activitiesGetServerActivities.ts
index d468bd9b..7405cb4f 100644
--- a/src/funcs/activitiesGetServerActivities.ts
+++ b/src/funcs/activitiesGetServerActivities.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Server Activities
*/
-export async function activitiesGetServerActivities(
+export function activitiesGetServerActivities(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetServerActivitiesResponse,
| errors.GetServerActivitiesBadRequest
@@ -43,6 +44,32 @@ export async function activitiesGetServerActivities(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetServerActivitiesResponse,
+ | errors.GetServerActivitiesBadRequest
+ | errors.GetServerActivitiesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/activities")();
@@ -55,6 +82,7 @@ export async function activitiesGetServerActivities(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getServerActivities",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function activitiesGetServerActivities(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function activitiesGetServerActivities(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function activitiesGetServerActivities(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/authenticationGetSourceConnectionInformation.ts b/src/funcs/authenticationGetSourceConnectionInformation.ts
index 71d9c99e..0c5914ac 100644
--- a/src/funcs/authenticationGetSourceConnectionInformation.ts
+++ b/src/funcs/authenticationGetSourceConnectionInformation.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -30,11 +31,11 @@ import { Result } from "../sdk/types/fp.js";
* If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token.
* Note: requires Plex Media Server >= 1.15.4.
*/
-export async function authenticationGetSourceConnectionInformation(
+export function authenticationGetSourceConnectionInformation(
client: PlexAPICore,
source: string,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetSourceConnectionInformationResponse,
| errors.GetSourceConnectionInformationBadRequest
@@ -47,6 +48,34 @@ export async function authenticationGetSourceConnectionInformation(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ source,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ source: string,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetSourceConnectionInformationResponse,
+ | errors.GetSourceConnectionInformationBadRequest
+ | errors.GetSourceConnectionInformationUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetSourceConnectionInformationRequest = {
source: source,
@@ -61,7 +90,7 @@ export async function authenticationGetSourceConnectionInformation(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -81,6 +110,7 @@ export async function authenticationGetSourceConnectionInformation(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getSourceConnectionInformation",
oAuth2Scopes: [],
@@ -104,7 +134,7 @@ export async function authenticationGetSourceConnectionInformation(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -115,7 +145,7 @@ export async function authenticationGetSourceConnectionInformation(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -152,8 +182,8 @@ export async function authenticationGetSourceConnectionInformation(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/authenticationGetTokenDetails.ts b/src/funcs/authenticationGetTokenDetails.ts
index d2ae11ae..a6a75c0b 100644
--- a/src/funcs/authenticationGetTokenDetails.ts
+++ b/src/funcs/authenticationGetTokenDetails.ts
@@ -20,6 +20,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetTokenDetailsServerList } from "../sdk/models/operations/gettokendetails.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -28,10 +29,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get the User data from the provided X-Plex-Token
*/
-export async function authenticationGetTokenDetails(
+export function authenticationGetTokenDetails(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetTokenDetailsResponse,
| errors.GetTokenDetailsBadRequest
@@ -44,6 +45,32 @@ export async function authenticationGetTokenDetails(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetTokenDetailsResponse,
+ | errors.GetTokenDetailsBadRequest
+ | errors.GetTokenDetailsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const baseURL = options?.serverURL
|| pathToFunc(GetTokenDetailsServerList[0], { charEncoding: "percent" })();
@@ -59,6 +86,7 @@ export async function authenticationGetTokenDetails(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: baseURL ?? "",
operationID: "getTokenDetails",
oAuth2Scopes: [],
@@ -80,7 +108,7 @@ export async function authenticationGetTokenDetails(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -91,7 +119,7 @@ export async function authenticationGetTokenDetails(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -124,8 +152,8 @@ export async function authenticationGetTokenDetails(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/authenticationGetTransientToken.ts b/src/funcs/authenticationGetTransientToken.ts
index 83726c22..9927c7d1 100644
--- a/src/funcs/authenticationGetTransientToken.ts
+++ b/src/funcs/authenticationGetTransientToken.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
*/
-export async function authenticationGetTransientToken(
+export function authenticationGetTransientToken(
client: PlexAPICore,
type: operations.GetTransientTokenQueryParamType,
scope: operations.Scope,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetTransientTokenResponse,
| errors.GetTransientTokenBadRequest
@@ -47,6 +48,36 @@ export async function authenticationGetTransientToken(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ type,
+ scope,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ type: operations.GetTransientTokenQueryParamType,
+ scope: operations.Scope,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetTransientTokenResponse,
+ | errors.GetTransientTokenBadRequest
+ | errors.GetTransientTokenUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetTransientTokenRequest = {
type: type,
@@ -59,7 +90,7 @@ export async function authenticationGetTransientToken(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -80,6 +111,7 @@ export async function authenticationGetTransientToken(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getTransientToken",
oAuth2Scopes: [],
@@ -103,7 +135,7 @@ export async function authenticationGetTransientToken(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +146,7 @@ export async function authenticationGetTransientToken(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -145,8 +177,8 @@ export async function authenticationGetTransientToken(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/authenticationPostUsersSignInData.ts b/src/funcs/authenticationPostUsersSignInData.ts
index 8958d9ff..94c5bd9c 100644
--- a/src/funcs/authenticationPostUsersSignInData.ts
+++ b/src/funcs/authenticationPostUsersSignInData.ts
@@ -21,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
import { PostUsersSignInDataServerList } from "../sdk/models/operations/postuserssignindata.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Sign in user with username and password and return user data with Plex authentication token
*/
-export async function authenticationPostUsersSignInData(
+export function authenticationPostUsersSignInData(
client: PlexAPICore,
request: operations.PostUsersSignInDataRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.PostUsersSignInDataResponse,
| errors.PostUsersSignInDataBadRequest
@@ -46,6 +47,34 @@ export async function authenticationPostUsersSignInData(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.PostUsersSignInDataRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.PostUsersSignInDataResponse,
+ | errors.PostUsersSignInDataBadRequest
+ | errors.PostUsersSignInDataUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -54,7 +83,7 @@ export async function authenticationPostUsersSignInData(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
@@ -96,6 +125,7 @@ export async function authenticationPostUsersSignInData(
}));
const context = {
+ baseURL: baseURL ?? "",
operationID: "post-users-sign-in-data",
oAuth2Scopes: [],
@@ -117,7 +147,7 @@ export async function authenticationPostUsersSignInData(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -128,7 +158,7 @@ export async function authenticationPostUsersSignInData(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -161,8 +191,8 @@ export async function authenticationPostUsersSignInData(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/butlerGetButlerTasks.ts b/src/funcs/butlerGetButlerTasks.ts
index ead491c7..b441acd3 100644
--- a/src/funcs/butlerGetButlerTasks.ts
+++ b/src/funcs/butlerGetButlerTasks.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Returns a list of butler tasks
*/
-export async function butlerGetButlerTasks(
+export function butlerGetButlerTasks(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetButlerTasksResponse,
| errors.GetButlerTasksBadRequest
@@ -43,6 +44,32 @@ export async function butlerGetButlerTasks(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetButlerTasksResponse,
+ | errors.GetButlerTasksBadRequest
+ | errors.GetButlerTasksUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/butler")();
@@ -55,6 +82,7 @@ export async function butlerGetButlerTasks(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getButlerTasks",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function butlerGetButlerTasks(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function butlerGetButlerTasks(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function butlerGetButlerTasks(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/butlerStartAllTasks.ts b/src/funcs/butlerStartAllTasks.ts
index a3e65166..2e0ae0b5 100644
--- a/src/funcs/butlerStartAllTasks.ts
+++ b/src/funcs/butlerStartAllTasks.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -31,10 +32,10 @@ import { Result } from "../sdk/types/fp.js";
* 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
* 4. If we are outside the configured window, the task will start immediately.
*/
-export async function butlerStartAllTasks(
+export function butlerStartAllTasks(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.StartAllTasksResponse,
| errors.StartAllTasksBadRequest
@@ -47,6 +48,32 @@ export async function butlerStartAllTasks(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.StartAllTasksResponse,
+ | errors.StartAllTasksBadRequest
+ | errors.StartAllTasksUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/butler")();
@@ -59,6 +86,7 @@ export async function butlerStartAllTasks(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "startAllTasks",
oAuth2Scopes: [],
@@ -80,7 +108,7 @@ export async function butlerStartAllTasks(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -91,7 +119,7 @@ export async function butlerStartAllTasks(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -122,8 +150,8 @@ export async function butlerStartAllTasks(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/butlerStartTask.ts b/src/funcs/butlerStartTask.ts
index d767e396..0273b46f 100644
--- a/src/funcs/butlerStartTask.ts
+++ b/src/funcs/butlerStartTask.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -33,11 +34,11 @@ import { Result } from "../sdk/types/fp.js";
* 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
* 4. If we are outside the configured window, the task will start immediately.
*/
-export async function butlerStartTask(
+export function butlerStartTask(
client: PlexAPICore,
taskName: operations.TaskName,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.StartTaskResponse,
| errors.StartTaskBadRequest
@@ -50,6 +51,34 @@ export async function butlerStartTask(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ taskName,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ taskName: operations.TaskName,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.StartTaskResponse,
+ | errors.StartTaskBadRequest
+ | errors.StartTaskUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.StartTaskRequest = {
taskName: taskName,
@@ -61,7 +90,7 @@ export async function butlerStartTask(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -84,6 +113,7 @@ export async function butlerStartTask(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "startTask",
oAuth2Scopes: [],
@@ -106,7 +136,7 @@ export async function butlerStartTask(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -117,7 +147,7 @@ export async function butlerStartTask(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -148,8 +178,8 @@ export async function butlerStartTask(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/butlerStopAllTasks.ts b/src/funcs/butlerStopAllTasks.ts
index 02516e2b..f2a77cfa 100644
--- a/src/funcs/butlerStopAllTasks.ts
+++ b/src/funcs/butlerStopAllTasks.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
*/
-export async function butlerStopAllTasks(
+export function butlerStopAllTasks(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.StopAllTasksResponse,
| errors.StopAllTasksBadRequest
@@ -43,6 +44,32 @@ export async function butlerStopAllTasks(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.StopAllTasksResponse,
+ | errors.StopAllTasksBadRequest
+ | errors.StopAllTasksUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/butler")();
@@ -55,6 +82,7 @@ export async function butlerStopAllTasks(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "stopAllTasks",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function butlerStopAllTasks(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function butlerStopAllTasks(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -118,8 +146,8 @@ export async function butlerStopAllTasks(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/butlerStopTask.ts b/src/funcs/butlerStopTask.ts
index 34747645..4abda3fe 100644
--- a/src/funcs/butlerStopTask.ts
+++ b/src/funcs/butlerStopTask.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
*/
-export async function butlerStopTask(
+export function butlerStopTask(
client: PlexAPICore,
taskName: operations.PathParamTaskName,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.StopTaskResponse,
| errors.StopTaskBadRequest
@@ -46,6 +47,34 @@ export async function butlerStopTask(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ taskName,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ taskName: operations.PathParamTaskName,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.StopTaskResponse,
+ | errors.StopTaskBadRequest
+ | errors.StopTaskUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.StopTaskRequest = {
taskName: taskName,
@@ -57,7 +86,7 @@ export async function butlerStopTask(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -80,6 +109,7 @@ export async function butlerStopTask(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "stopTask",
oAuth2Scopes: [],
@@ -102,7 +132,7 @@ export async function butlerStopTask(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -113,7 +143,7 @@ export async function butlerStopTask(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -144,8 +174,8 @@ export async function butlerStopTask(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/hubsGetGlobalHubs.ts b/src/funcs/hubsGetGlobalHubs.ts
index daf5ea84..6a577a27 100644
--- a/src/funcs/hubsGetGlobalHubs.ts
+++ b/src/funcs/hubsGetGlobalHubs.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Global Hubs filtered by the parameters provided.
*/
-export async function hubsGetGlobalHubs(
+export function hubsGetGlobalHubs(
client: PlexAPICore,
count?: number | undefined,
onlyTransient?: operations.OnlyTransient | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetGlobalHubsResponse,
| errors.GetGlobalHubsBadRequest
@@ -47,6 +48,36 @@ export async function hubsGetGlobalHubs(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ count,
+ onlyTransient,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ count?: number | undefined,
+ onlyTransient?: operations.OnlyTransient | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetGlobalHubsResponse,
+ | errors.GetGlobalHubsBadRequest
+ | errors.GetGlobalHubsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetGlobalHubsRequest = {
count: count,
@@ -59,7 +90,7 @@ export async function hubsGetGlobalHubs(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -80,6 +111,7 @@ export async function hubsGetGlobalHubs(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getGlobalHubs",
oAuth2Scopes: [],
@@ -103,7 +135,7 @@ export async function hubsGetGlobalHubs(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +146,7 @@ export async function hubsGetGlobalHubs(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -147,8 +179,8 @@ export async function hubsGetGlobalHubs(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/hubsGetLibraryHubs.ts b/src/funcs/hubsGetLibraryHubs.ts
index 6c999c34..811e1fe4 100644
--- a/src/funcs/hubsGetLibraryHubs.ts
+++ b/src/funcs/hubsGetLibraryHubs.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,13 +30,13 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will return a list of library specific hubs
*/
-export async function hubsGetLibraryHubs(
+export function hubsGetLibraryHubs(
client: PlexAPICore,
sectionId: number,
count?: number | undefined,
onlyTransient?: operations.QueryParamOnlyTransient | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetLibraryHubsResponse,
| errors.GetLibraryHubsBadRequest
@@ -48,6 +49,38 @@ export async function hubsGetLibraryHubs(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sectionId,
+ count,
+ onlyTransient,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sectionId: number,
+ count?: number | undefined,
+ onlyTransient?: operations.QueryParamOnlyTransient | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetLibraryHubsResponse,
+ | errors.GetLibraryHubsBadRequest
+ | errors.GetLibraryHubsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetLibraryHubsRequest = {
sectionId: sectionId,
@@ -61,7 +94,7 @@ export async function hubsGetLibraryHubs(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -89,6 +122,7 @@ export async function hubsGetLibraryHubs(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getLibraryHubs",
oAuth2Scopes: [],
@@ -112,7 +146,7 @@ export async function hubsGetLibraryHubs(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -123,7 +157,7 @@ export async function hubsGetLibraryHubs(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -156,8 +190,8 @@ export async function hubsGetLibraryHubs(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/hubsGetRecentlyAdded.ts b/src/funcs/hubsGetRecentlyAdded.ts
index 7f1f07fd..15af03b1 100644
--- a/src/funcs/hubsGetRecentlyAdded.ts
+++ b/src/funcs/hubsGetRecentlyAdded.ts
@@ -20,6 +20,7 @@ import {
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -28,11 +29,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will return the recently added content.
*/
-export async function hubsGetRecentlyAdded(
+export function hubsGetRecentlyAdded(
client: PlexAPICore,
request: operations.GetRecentlyAddedRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetRecentlyAddedResponse,
| SDKError
@@ -43,6 +44,32 @@ export async function hubsGetRecentlyAdded(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetRecentlyAddedRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetRecentlyAddedResponse,
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -50,7 +77,7 @@ export async function hubsGetRecentlyAdded(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -76,6 +103,7 @@ export async function hubsGetRecentlyAdded(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-recently-added",
oAuth2Scopes: [],
@@ -99,7 +127,7 @@ export async function hubsGetRecentlyAdded(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -110,7 +138,7 @@ export async function hubsGetRecentlyAdded(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -139,8 +167,8 @@ export async function hubsGetRecentlyAdded(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryDeleteLibrary.ts b/src/funcs/libraryDeleteLibrary.ts
index bda37d18..7af9e1e6 100644
--- a/src/funcs/libraryDeleteLibrary.ts
+++ b/src/funcs/libraryDeleteLibrary.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Delete a library using a specific section id
*/
-export async function libraryDeleteLibrary(
+export function libraryDeleteLibrary(
client: PlexAPICore,
sectionKey: number,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.DeleteLibraryResponse,
| errors.DeleteLibraryBadRequest
@@ -46,6 +47,34 @@ export async function libraryDeleteLibrary(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sectionKey,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sectionKey: number,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.DeleteLibraryResponse,
+ | errors.DeleteLibraryBadRequest
+ | errors.DeleteLibraryUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.DeleteLibraryRequest = {
sectionKey: sectionKey,
@@ -57,7 +86,7 @@ export async function libraryDeleteLibrary(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -80,6 +109,7 @@ export async function libraryDeleteLibrary(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "deleteLibrary",
oAuth2Scopes: [],
@@ -102,7 +132,7 @@ export async function libraryDeleteLibrary(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -113,7 +143,7 @@ export async function libraryDeleteLibrary(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -144,8 +174,8 @@ export async function libraryDeleteLibrary(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetActorsLibrary.ts b/src/funcs/libraryGetActorsLibrary.ts
index 3ffa8b8b..52929fac 100644
--- a/src/funcs/libraryGetActorsLibrary.ts
+++ b/src/funcs/libraryGetActorsLibrary.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Retrieves a list of all the actors that are found for the media in this library.
*/
-export async function libraryGetActorsLibrary(
+export function libraryGetActorsLibrary(
client: PlexAPICore,
sectionKey: number,
type: operations.GetActorsLibraryQueryParamType,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetActorsLibraryResponse,
| errors.GetActorsLibraryBadRequest
@@ -47,6 +48,36 @@ export async function libraryGetActorsLibrary(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sectionKey,
+ type,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sectionKey: number,
+ type: operations.GetActorsLibraryQueryParamType,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetActorsLibraryResponse,
+ | errors.GetActorsLibraryBadRequest
+ | errors.GetActorsLibraryUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetActorsLibraryRequest = {
sectionKey: sectionKey,
@@ -59,7 +90,7 @@ export async function libraryGetActorsLibrary(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -86,6 +117,7 @@ export async function libraryGetActorsLibrary(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-actors-library",
oAuth2Scopes: [],
@@ -109,7 +141,7 @@ export async function libraryGetActorsLibrary(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -120,7 +152,7 @@ export async function libraryGetActorsLibrary(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -153,8 +185,8 @@ export async function libraryGetActorsLibrary(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetAllLibraries.ts b/src/funcs/libraryGetAllLibraries.ts
index 1af0848f..07a16ea3 100644
--- a/src/funcs/libraryGetAllLibraries.ts
+++ b/src/funcs/libraryGetAllLibraries.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -32,10 +33,10 @@ import { Result } from "../sdk/types/fp.js";
* Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts.
* This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).
*/
-export async function libraryGetAllLibraries(
+export function libraryGetAllLibraries(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetAllLibrariesResponse,
| errors.GetAllLibrariesBadRequest
@@ -48,6 +49,32 @@ export async function libraryGetAllLibraries(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetAllLibrariesResponse,
+ | errors.GetAllLibrariesBadRequest
+ | errors.GetAllLibrariesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/library/sections")();
@@ -60,6 +87,7 @@ export async function libraryGetAllLibraries(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-all-libraries",
oAuth2Scopes: [],
@@ -81,7 +109,7 @@ export async function libraryGetAllLibraries(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -92,7 +120,7 @@ export async function libraryGetAllLibraries(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -125,8 +153,8 @@ export async function libraryGetAllLibraries(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetAllMediaLibrary.ts b/src/funcs/libraryGetAllMediaLibrary.ts
index 7597c62c..65a1af49 100644
--- a/src/funcs/libraryGetAllMediaLibrary.ts
+++ b/src/funcs/libraryGetAllMediaLibrary.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Retrieves a list of all general media data for this library.
*/
-export async function libraryGetAllMediaLibrary(
+export function libraryGetAllMediaLibrary(
client: PlexAPICore,
request: operations.GetAllMediaLibraryRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetAllMediaLibraryResponse,
| errors.GetAllMediaLibraryBadRequest
@@ -46,6 +47,34 @@ export async function libraryGetAllMediaLibrary(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetAllMediaLibraryRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetAllMediaLibraryResponse,
+ | errors.GetAllMediaLibraryBadRequest
+ | errors.GetAllMediaLibraryUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -53,7 +82,7 @@ export async function libraryGetAllMediaLibrary(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -87,6 +116,7 @@ export async function libraryGetAllMediaLibrary(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-all-media-library",
oAuth2Scopes: [],
@@ -110,7 +140,7 @@ export async function libraryGetAllMediaLibrary(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -121,7 +151,7 @@ export async function libraryGetAllMediaLibrary(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -154,8 +184,8 @@ export async function libraryGetAllMediaLibrary(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetCountriesLibrary.ts b/src/funcs/libraryGetCountriesLibrary.ts
index 7fc47e4b..9e7782f7 100644
--- a/src/funcs/libraryGetCountriesLibrary.ts
+++ b/src/funcs/libraryGetCountriesLibrary.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Retrieves a list of all the countries that are found for the media in this library.
*/
-export async function libraryGetCountriesLibrary(
+export function libraryGetCountriesLibrary(
client: PlexAPICore,
sectionKey: number,
type: operations.GetCountriesLibraryQueryParamType,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetCountriesLibraryResponse,
| errors.GetCountriesLibraryBadRequest
@@ -47,6 +48,36 @@ export async function libraryGetCountriesLibrary(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sectionKey,
+ type,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sectionKey: number,
+ type: operations.GetCountriesLibraryQueryParamType,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetCountriesLibraryResponse,
+ | errors.GetCountriesLibraryBadRequest
+ | errors.GetCountriesLibraryUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetCountriesLibraryRequest = {
sectionKey: sectionKey,
@@ -60,7 +91,7 @@ export async function libraryGetCountriesLibrary(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -87,6 +118,7 @@ export async function libraryGetCountriesLibrary(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-countries-library",
oAuth2Scopes: [],
@@ -110,7 +142,7 @@ export async function libraryGetCountriesLibrary(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -121,7 +153,7 @@ export async function libraryGetCountriesLibrary(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -154,8 +186,8 @@ export async function libraryGetCountriesLibrary(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetFileHash.ts b/src/funcs/libraryGetFileHash.ts
index ed239c04..31476429 100644
--- a/src/funcs/libraryGetFileHash.ts
+++ b/src/funcs/libraryGetFileHash.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This resource returns hash values for local files
*/
-export async function libraryGetFileHash(
+export function libraryGetFileHash(
client: PlexAPICore,
url: string,
type?: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetFileHashResponse,
| errors.GetFileHashBadRequest
@@ -47,6 +48,36 @@ export async function libraryGetFileHash(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ url,
+ type,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ url: string,
+ type?: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetFileHashResponse,
+ | errors.GetFileHashBadRequest
+ | errors.GetFileHashUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetFileHashRequest = {
url: url,
@@ -59,7 +90,7 @@ export async function libraryGetFileHash(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -80,6 +111,7 @@ export async function libraryGetFileHash(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getFileHash",
oAuth2Scopes: [],
@@ -103,7 +135,7 @@ export async function libraryGetFileHash(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +146,7 @@ export async function libraryGetFileHash(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -145,8 +177,8 @@ export async function libraryGetFileHash(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetGenresLibrary.ts b/src/funcs/libraryGetGenresLibrary.ts
index 1d4439eb..e3e9e054 100644
--- a/src/funcs/libraryGetGenresLibrary.ts
+++ b/src/funcs/libraryGetGenresLibrary.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Retrieves a list of all the genres that are found for the media in this library.
*/
-export async function libraryGetGenresLibrary(
+export function libraryGetGenresLibrary(
client: PlexAPICore,
sectionKey: number,
type: operations.GetGenresLibraryQueryParamType,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetGenresLibraryResponse,
| errors.GetGenresLibraryBadRequest
@@ -47,6 +48,36 @@ export async function libraryGetGenresLibrary(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sectionKey,
+ type,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sectionKey: number,
+ type: operations.GetGenresLibraryQueryParamType,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetGenresLibraryResponse,
+ | errors.GetGenresLibraryBadRequest
+ | errors.GetGenresLibraryUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetGenresLibraryRequest = {
sectionKey: sectionKey,
@@ -59,7 +90,7 @@ export async function libraryGetGenresLibrary(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -86,6 +117,7 @@ export async function libraryGetGenresLibrary(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-genres-library",
oAuth2Scopes: [],
@@ -109,7 +141,7 @@ export async function libraryGetGenresLibrary(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -120,7 +152,7 @@ export async function libraryGetGenresLibrary(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -153,8 +185,8 @@ export async function libraryGetGenresLibrary(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetLibraryDetails.ts b/src/funcs/libraryGetLibraryDetails.ts
index e850ef78..ddb299f1 100644
--- a/src/funcs/libraryGetLibraryDetails.ts
+++ b/src/funcs/libraryGetLibraryDetails.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -67,12 +68,12 @@ import { Result } from "../sdk/types/fp.js";
*
* > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
*/
-export async function libraryGetLibraryDetails(
+export function libraryGetLibraryDetails(
client: PlexAPICore,
sectionKey: number,
includeDetails?: operations.IncludeDetails | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetLibraryDetailsResponse,
| errors.GetLibraryDetailsBadRequest
@@ -85,6 +86,36 @@ export async function libraryGetLibraryDetails(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sectionKey,
+ includeDetails,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sectionKey: number,
+ includeDetails?: operations.IncludeDetails | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetLibraryDetailsResponse,
+ | errors.GetLibraryDetailsBadRequest
+ | errors.GetLibraryDetailsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetLibraryDetailsRequest = {
sectionKey: sectionKey,
@@ -97,7 +128,7 @@ export async function libraryGetLibraryDetails(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -124,6 +155,7 @@ export async function libraryGetLibraryDetails(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-library-details",
oAuth2Scopes: [],
@@ -147,7 +179,7 @@ export async function libraryGetLibraryDetails(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -158,7 +190,7 @@ export async function libraryGetLibraryDetails(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -191,8 +223,8 @@ export async function libraryGetLibraryDetails(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetLibraryItems.ts b/src/funcs/libraryGetLibraryItems.ts
index 4ca0de60..717f431c 100644
--- a/src/funcs/libraryGetLibraryItems.ts
+++ b/src/funcs/libraryGetLibraryItems.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -49,11 +50,11 @@ import { Result } from "../sdk/types/fp.js";
* - `folder`: Items categorized by folder.
* - `albums`: Items categorized by album.
*/
-export async function libraryGetLibraryItems(
+export function libraryGetLibraryItems(
client: PlexAPICore,
request: operations.GetLibraryItemsRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetLibraryItemsResponse,
| errors.GetLibraryItemsBadRequest
@@ -66,6 +67,34 @@ export async function libraryGetLibraryItems(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetLibraryItemsRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetLibraryItemsResponse,
+ | errors.GetLibraryItemsBadRequest
+ | errors.GetLibraryItemsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -73,7 +102,7 @@ export async function libraryGetLibraryItems(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -108,6 +137,7 @@ export async function libraryGetLibraryItems(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-library-items",
oAuth2Scopes: [],
@@ -131,7 +161,7 @@ export async function libraryGetLibraryItems(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -142,7 +172,7 @@ export async function libraryGetLibraryItems(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -175,8 +205,8 @@ export async function libraryGetLibraryItems(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetMediaMetaData.ts b/src/funcs/libraryGetMediaMetaData.ts
index 7d832b6b..a00c97d3 100644
--- a/src/funcs/libraryGetMediaMetaData.ts
+++ b/src/funcs/libraryGetMediaMetaData.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will return all the (meta)data of a library item specified with by the ratingKey.
*/
-export async function libraryGetMediaMetaData(
+export function libraryGetMediaMetaData(
client: PlexAPICore,
request: operations.GetMediaMetaDataRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetMediaMetaDataResponse,
| errors.GetMediaMetaDataBadRequest
@@ -46,6 +47,34 @@ export async function libraryGetMediaMetaData(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetMediaMetaDataRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetMediaMetaDataResponse,
+ | errors.GetMediaMetaDataBadRequest
+ | errors.GetMediaMetaDataUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -53,7 +82,7 @@ export async function libraryGetMediaMetaData(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -92,6 +121,7 @@ export async function libraryGetMediaMetaData(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-media-meta-data",
oAuth2Scopes: [],
@@ -115,7 +145,7 @@ export async function libraryGetMediaMetaData(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -126,7 +156,7 @@ export async function libraryGetMediaMetaData(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -159,8 +189,8 @@ export async function libraryGetMediaMetaData(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetMetadataChildren.ts b/src/funcs/libraryGetMetadataChildren.ts
index 067ed110..3c67a4ee 100644
--- a/src/funcs/libraryGetMetadataChildren.ts
+++ b/src/funcs/libraryGetMetadataChildren.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will return the children of of a library item specified with the ratingKey.
*/
-export async function libraryGetMetadataChildren(
+export function libraryGetMetadataChildren(
client: PlexAPICore,
ratingKey: number,
includeElements?: string | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetMetadataChildrenResponse,
| errors.GetMetadataChildrenBadRequest
@@ -47,6 +48,36 @@ export async function libraryGetMetadataChildren(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ ratingKey,
+ includeElements,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ ratingKey: number,
+ includeElements?: string | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetMetadataChildrenResponse,
+ | errors.GetMetadataChildrenBadRequest
+ | errors.GetMetadataChildrenUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetMetadataChildrenRequest = {
ratingKey: ratingKey,
@@ -60,7 +91,7 @@ export async function libraryGetMetadataChildren(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -87,6 +118,7 @@ export async function libraryGetMetadataChildren(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getMetadataChildren",
oAuth2Scopes: [],
@@ -110,7 +142,7 @@ export async function libraryGetMetadataChildren(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -121,7 +153,7 @@ export async function libraryGetMetadataChildren(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -154,8 +186,8 @@ export async function libraryGetMetadataChildren(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetOnDeck.ts b/src/funcs/libraryGetOnDeck.ts
index c653acbf..5383b9f5 100644
--- a/src/funcs/libraryGetOnDeck.ts
+++ b/src/funcs/libraryGetOnDeck.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will return the on deck content.
*/
-export async function libraryGetOnDeck(
+export function libraryGetOnDeck(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetOnDeckResponse,
| errors.GetOnDeckBadRequest
@@ -43,6 +44,32 @@ export async function libraryGetOnDeck(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetOnDeckResponse,
+ | errors.GetOnDeckBadRequest
+ | errors.GetOnDeckUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/library/onDeck")();
@@ -55,6 +82,7 @@ export async function libraryGetOnDeck(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getOnDeck",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function libraryGetOnDeck(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function libraryGetOnDeck(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -118,8 +146,8 @@ export async function libraryGetOnDeck(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetRecentlyAddedLibrary.ts b/src/funcs/libraryGetRecentlyAddedLibrary.ts
index 25d111df..9d0d9994 100644
--- a/src/funcs/libraryGetRecentlyAddedLibrary.ts
+++ b/src/funcs/libraryGetRecentlyAddedLibrary.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will return the recently added content.
*/
-export async function libraryGetRecentlyAddedLibrary(
+export function libraryGetRecentlyAddedLibrary(
client: PlexAPICore,
request: operations.GetRecentlyAddedLibraryRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetRecentlyAddedLibraryResponse,
| errors.GetRecentlyAddedLibraryBadRequest
@@ -46,6 +47,34 @@ export async function libraryGetRecentlyAddedLibrary(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetRecentlyAddedLibraryRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetRecentlyAddedLibraryResponse,
+ | errors.GetRecentlyAddedLibraryBadRequest
+ | errors.GetRecentlyAddedLibraryUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -54,7 +83,7 @@ export async function libraryGetRecentlyAddedLibrary(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -80,6 +109,7 @@ export async function libraryGetRecentlyAddedLibrary(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-recently-added-library",
oAuth2Scopes: [],
@@ -103,7 +133,7 @@ export async function libraryGetRecentlyAddedLibrary(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +144,7 @@ export async function libraryGetRecentlyAddedLibrary(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -147,8 +177,8 @@ export async function libraryGetRecentlyAddedLibrary(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetRefreshLibraryMetadata.ts b/src/funcs/libraryGetRefreshLibraryMetadata.ts
index ed13a321..e4972e52 100644
--- a/src/funcs/libraryGetRefreshLibraryMetadata.ts
+++ b/src/funcs/libraryGetRefreshLibraryMetadata.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint Refreshes all the Metadata of the library.
*/
-export async function libraryGetRefreshLibraryMetadata(
+export function libraryGetRefreshLibraryMetadata(
client: PlexAPICore,
sectionKey: number,
force?: operations.Force | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetRefreshLibraryMetadataResponse,
| errors.GetRefreshLibraryMetadataBadRequest
@@ -47,6 +48,36 @@ export async function libraryGetRefreshLibraryMetadata(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sectionKey,
+ force,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sectionKey: number,
+ force?: operations.Force | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetRefreshLibraryMetadataResponse,
+ | errors.GetRefreshLibraryMetadataBadRequest
+ | errors.GetRefreshLibraryMetadataUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetRefreshLibraryMetadataRequest = {
sectionKey: sectionKey,
@@ -60,7 +91,7 @@ export async function libraryGetRefreshLibraryMetadata(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -87,6 +118,7 @@ export async function libraryGetRefreshLibraryMetadata(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-refresh-library-metadata",
oAuth2Scopes: [],
@@ -110,7 +142,7 @@ export async function libraryGetRefreshLibraryMetadata(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -121,7 +153,7 @@ export async function libraryGetRefreshLibraryMetadata(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -152,8 +184,8 @@ export async function libraryGetRefreshLibraryMetadata(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetSearchAllLibraries.ts b/src/funcs/libraryGetSearchAllLibraries.ts
index 23fe6690..96b45d05 100644
--- a/src/funcs/libraryGetSearchAllLibraries.ts
+++ b/src/funcs/libraryGetSearchAllLibraries.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.
*/
-export async function libraryGetSearchAllLibraries(
+export function libraryGetSearchAllLibraries(
client: PlexAPICore,
request: operations.GetSearchAllLibrariesRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetSearchAllLibrariesResponse,
| errors.GetSearchAllLibrariesBadRequest
@@ -46,6 +47,34 @@ export async function libraryGetSearchAllLibraries(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetSearchAllLibrariesRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetSearchAllLibrariesResponse,
+ | errors.GetSearchAllLibrariesBadRequest
+ | errors.GetSearchAllLibrariesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -54,7 +83,7 @@ export async function libraryGetSearchAllLibraries(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -87,6 +116,7 @@ export async function libraryGetSearchAllLibraries(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-search-all-libraries",
oAuth2Scopes: [],
@@ -110,7 +140,7 @@ export async function libraryGetSearchAllLibraries(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -121,7 +151,7 @@ export async function libraryGetSearchAllLibraries(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -154,8 +184,8 @@ export async function libraryGetSearchAllLibraries(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetSearchLibrary.ts b/src/funcs/libraryGetSearchLibrary.ts
index 48e990d5..9c752f39 100644
--- a/src/funcs/libraryGetSearchLibrary.ts
+++ b/src/funcs/libraryGetSearchLibrary.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -46,12 +47,12 @@ import { Result } from "../sdk/types/fp.js";
*
* > **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
*/
-export async function libraryGetSearchLibrary(
+export function libraryGetSearchLibrary(
client: PlexAPICore,
sectionKey: number,
type: operations.GetSearchLibraryQueryParamType,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetSearchLibraryResponse,
| errors.GetSearchLibraryBadRequest
@@ -64,6 +65,36 @@ export async function libraryGetSearchLibrary(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sectionKey,
+ type,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sectionKey: number,
+ type: operations.GetSearchLibraryQueryParamType,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetSearchLibraryResponse,
+ | errors.GetSearchLibraryBadRequest
+ | errors.GetSearchLibraryUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetSearchLibraryRequest = {
sectionKey: sectionKey,
@@ -76,7 +107,7 @@ export async function libraryGetSearchLibrary(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -103,6 +134,7 @@ export async function libraryGetSearchLibrary(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-search-library",
oAuth2Scopes: [],
@@ -126,7 +158,7 @@ export async function libraryGetSearchLibrary(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -137,7 +169,7 @@ export async function libraryGetSearchLibrary(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -170,8 +202,8 @@ export async function libraryGetSearchLibrary(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/libraryGetTopWatchedContent.ts b/src/funcs/libraryGetTopWatchedContent.ts
index 4ed19419..4def5627 100644
--- a/src/funcs/libraryGetTopWatchedContent.ts
+++ b/src/funcs/libraryGetTopWatchedContent.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will return the top watched content from libraries of a certain type
*/
-export async function libraryGetTopWatchedContent(
+export function libraryGetTopWatchedContent(
client: PlexAPICore,
type: operations.GetTopWatchedContentQueryParamType,
includeGuids?: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetTopWatchedContentResponse,
| errors.GetTopWatchedContentBadRequest
@@ -47,6 +48,36 @@ export async function libraryGetTopWatchedContent(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ type,
+ includeGuids,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ type: operations.GetTopWatchedContentQueryParamType,
+ includeGuids?: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetTopWatchedContentResponse,
+ | errors.GetTopWatchedContentBadRequest
+ | errors.GetTopWatchedContentUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetTopWatchedContentRequest = {
type: type,
@@ -60,7 +91,7 @@ export async function libraryGetTopWatchedContent(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -81,6 +112,7 @@ export async function libraryGetTopWatchedContent(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getTopWatchedContent",
oAuth2Scopes: [],
@@ -104,7 +136,7 @@ export async function libraryGetTopWatchedContent(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -115,7 +147,7 @@ export async function libraryGetTopWatchedContent(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -148,8 +180,8 @@ export async function libraryGetTopWatchedContent(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/logEnablePaperTrail.ts b/src/funcs/logEnablePaperTrail.ts
index 537841d2..3f327afb 100644
--- a/src/funcs/logEnablePaperTrail.ts
+++ b/src/funcs/logEnablePaperTrail.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
*/
-export async function logEnablePaperTrail(
+export function logEnablePaperTrail(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.EnablePaperTrailResponse,
| errors.EnablePaperTrailBadRequest
@@ -43,6 +44,32 @@ export async function logEnablePaperTrail(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.EnablePaperTrailResponse,
+ | errors.EnablePaperTrailBadRequest
+ | errors.EnablePaperTrailUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/log/networked")();
@@ -55,6 +82,7 @@ export async function logEnablePaperTrail(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "enablePaperTrail",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function logEnablePaperTrail(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function logEnablePaperTrail(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -118,8 +146,8 @@ export async function logEnablePaperTrail(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/logLogLine.ts b/src/funcs/logLogLine.ts
index a60005d0..09ec933d 100644
--- a/src/funcs/logLogLine.ts
+++ b/src/funcs/logLogLine.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,13 +30,13 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
*/
-export async function logLogLine(
+export function logLogLine(
client: PlexAPICore,
level: operations.Level,
message: string,
source: string,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.LogLineResponse,
| errors.LogLineBadRequest
@@ -48,6 +49,38 @@ export async function logLogLine(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ level,
+ message,
+ source,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ level: operations.Level,
+ message: string,
+ source: string,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.LogLineResponse,
+ | errors.LogLineBadRequest
+ | errors.LogLineUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.LogLineRequest = {
level: level,
@@ -61,7 +94,7 @@ export async function logLogLine(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -83,6 +116,7 @@ export async function logLogLine(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "logLine",
oAuth2Scopes: [],
@@ -106,7 +140,7 @@ export async function logLogLine(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -117,7 +151,7 @@ export async function logLogLine(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -148,8 +182,8 @@ export async function logLogLine(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/logLogMultiLine.ts b/src/funcs/logLogMultiLine.ts
index 59e42f42..77a5e223 100644
--- a/src/funcs/logLogMultiLine.ts
+++ b/src/funcs/logLogMultiLine.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -49,11 +50,11 @@ import { Result } from "../sdk/types/fp.js";
*
* Ensure each parameter is properly URL-encoded to avoid interpretation issues.
*/
-export async function logLogMultiLine(
+export function logLogMultiLine(
client: PlexAPICore,
request: string,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.LogMultiLineResponse,
| errors.LogMultiLineBadRequest
@@ -66,6 +67,34 @@ export async function logLogMultiLine(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: string,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.LogMultiLineResponse,
+ | errors.LogMultiLineBadRequest
+ | errors.LogMultiLineUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -73,7 +102,7 @@ export async function logLogMultiLine(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = payload;
@@ -90,6 +119,7 @@ export async function logLogMultiLine(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "logMultiLine",
oAuth2Scopes: [],
@@ -112,7 +142,7 @@ export async function logLogMultiLine(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -123,7 +153,7 @@ export async function logLogMultiLine(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -154,8 +184,8 @@ export async function logLogMultiLine(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/mediaGetBannerImage.ts b/src/funcs/mediaGetBannerImage.ts
index cbe211f7..64d3354c 100644
--- a/src/funcs/mediaGetBannerImage.ts
+++ b/src/funcs/mediaGetBannerImage.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Gets the banner image of the media item
*/
-export async function mediaGetBannerImage(
+export function mediaGetBannerImage(
client: PlexAPICore,
request: operations.GetBannerImageRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetBannerImageResponse,
| errors.GetBannerImageBadRequest
@@ -46,6 +47,34 @@ export async function mediaGetBannerImage(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetBannerImageRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetBannerImageResponse,
+ | errors.GetBannerImageBadRequest
+ | errors.GetBannerImageUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -53,7 +82,7 @@ export async function mediaGetBannerImage(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -87,6 +116,7 @@ export async function mediaGetBannerImage(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-banner-image",
oAuth2Scopes: [],
@@ -110,7 +140,7 @@ export async function mediaGetBannerImage(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -121,7 +151,7 @@ export async function mediaGetBannerImage(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -156,8 +186,8 @@ export async function mediaGetBannerImage(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/mediaGetThumbImage.ts b/src/funcs/mediaGetThumbImage.ts
index b67b3309..dc0246dc 100644
--- a/src/funcs/mediaGetThumbImage.ts
+++ b/src/funcs/mediaGetThumbImage.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Gets the thumbnail image of the media item
*/
-export async function mediaGetThumbImage(
+export function mediaGetThumbImage(
client: PlexAPICore,
request: operations.GetThumbImageRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetThumbImageResponse,
| errors.GetThumbImageBadRequest
@@ -46,6 +47,34 @@ export async function mediaGetThumbImage(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetThumbImageRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetThumbImageResponse,
+ | errors.GetThumbImageBadRequest
+ | errors.GetThumbImageUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -53,7 +82,7 @@ export async function mediaGetThumbImage(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -87,6 +116,7 @@ export async function mediaGetThumbImage(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-thumb-image",
oAuth2Scopes: [],
@@ -110,7 +140,7 @@ export async function mediaGetThumbImage(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -121,7 +151,7 @@ export async function mediaGetThumbImage(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -156,8 +186,8 @@ export async function mediaGetThumbImage(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/mediaMarkPlayed.ts b/src/funcs/mediaMarkPlayed.ts
index 9b499398..357368b4 100644
--- a/src/funcs/mediaMarkPlayed.ts
+++ b/src/funcs/mediaMarkPlayed.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This will mark the provided media key as Played.
*/
-export async function mediaMarkPlayed(
+export function mediaMarkPlayed(
client: PlexAPICore,
key: number,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.MarkPlayedResponse,
| errors.MarkPlayedBadRequest
@@ -46,6 +47,34 @@ export async function mediaMarkPlayed(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ key,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ key: number,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.MarkPlayedResponse,
+ | errors.MarkPlayedBadRequest
+ | errors.MarkPlayedUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.MarkPlayedRequest = {
key: key,
@@ -57,7 +86,7 @@ export async function mediaMarkPlayed(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -77,6 +106,7 @@ export async function mediaMarkPlayed(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "markPlayed",
oAuth2Scopes: [],
@@ -100,7 +130,7 @@ export async function mediaMarkPlayed(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -111,7 +141,7 @@ export async function mediaMarkPlayed(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -142,8 +172,8 @@ export async function mediaMarkPlayed(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/mediaMarkUnplayed.ts b/src/funcs/mediaMarkUnplayed.ts
index a88e0976..8f74c413 100644
--- a/src/funcs/mediaMarkUnplayed.ts
+++ b/src/funcs/mediaMarkUnplayed.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This will mark the provided media key as Unplayed.
*/
-export async function mediaMarkUnplayed(
+export function mediaMarkUnplayed(
client: PlexAPICore,
key: number,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.MarkUnplayedResponse,
| errors.MarkUnplayedBadRequest
@@ -46,6 +47,34 @@ export async function mediaMarkUnplayed(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ key,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ key: number,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.MarkUnplayedResponse,
+ | errors.MarkUnplayedBadRequest
+ | errors.MarkUnplayedUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.MarkUnplayedRequest = {
key: key,
@@ -57,7 +86,7 @@ export async function mediaMarkUnplayed(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -77,6 +106,7 @@ export async function mediaMarkUnplayed(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "markUnplayed",
oAuth2Scopes: [],
@@ -100,7 +130,7 @@ export async function mediaMarkUnplayed(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -111,7 +141,7 @@ export async function mediaMarkUnplayed(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -142,8 +172,8 @@ export async function mediaMarkUnplayed(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/mediaUpdatePlayProgress.ts b/src/funcs/mediaUpdatePlayProgress.ts
index 0792cf1e..0c6c8a82 100644
--- a/src/funcs/mediaUpdatePlayProgress.ts
+++ b/src/funcs/mediaUpdatePlayProgress.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,13 +30,13 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This API command can be used to update the play progress of a media item.
*/
-export async function mediaUpdatePlayProgress(
+export function mediaUpdatePlayProgress(
client: PlexAPICore,
key: string,
time: number,
state: string,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.UpdatePlayProgressResponse,
| errors.UpdatePlayProgressBadRequest
@@ -48,6 +49,38 @@ export async function mediaUpdatePlayProgress(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ key,
+ time,
+ state,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ key: string,
+ time: number,
+ state: string,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.UpdatePlayProgressResponse,
+ | errors.UpdatePlayProgressBadRequest
+ | errors.UpdatePlayProgressUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.UpdatePlayProgressRequest = {
key: key,
@@ -61,7 +94,7 @@ export async function mediaUpdatePlayProgress(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -83,6 +116,7 @@ export async function mediaUpdatePlayProgress(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "updatePlayProgress",
oAuth2Scopes: [],
@@ -106,7 +140,7 @@ export async function mediaUpdatePlayProgress(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -117,7 +151,7 @@ export async function mediaUpdatePlayProgress(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -148,8 +182,8 @@ export async function mediaUpdatePlayProgress(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/playlistsAddPlaylistContents.ts b/src/funcs/playlistsAddPlaylistContents.ts
index d7e2adc1..17439592 100644
--- a/src/funcs/playlistsAddPlaylistContents.ts
+++ b/src/funcs/playlistsAddPlaylistContents.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -30,13 +31,13 @@ import { Result } from "../sdk/types/fp.js";
* Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist.
* With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist.
*/
-export async function playlistsAddPlaylistContents(
+export function playlistsAddPlaylistContents(
client: PlexAPICore,
playlistID: number,
uri: string,
playQueueID?: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.AddPlaylistContentsResponse,
| errors.AddPlaylistContentsBadRequest
@@ -49,6 +50,38 @@ export async function playlistsAddPlaylistContents(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ playlistID,
+ uri,
+ playQueueID,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ playlistID: number,
+ uri: string,
+ playQueueID?: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.AddPlaylistContentsResponse,
+ | errors.AddPlaylistContentsBadRequest
+ | errors.AddPlaylistContentsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.AddPlaylistContentsRequest = {
playlistID: playlistID,
@@ -63,7 +96,7 @@ export async function playlistsAddPlaylistContents(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -91,6 +124,7 @@ export async function playlistsAddPlaylistContents(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "addPlaylistContents",
oAuth2Scopes: [],
@@ -114,7 +148,7 @@ export async function playlistsAddPlaylistContents(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -125,7 +159,7 @@ export async function playlistsAddPlaylistContents(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -158,8 +192,8 @@ export async function playlistsAddPlaylistContents(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/playlistsClearPlaylistContents.ts b/src/funcs/playlistsClearPlaylistContents.ts
index 537ca614..5e580f8a 100644
--- a/src/funcs/playlistsClearPlaylistContents.ts
+++ b/src/funcs/playlistsClearPlaylistContents.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Clears a playlist, only works with dumb playlists. Returns the playlist.
*/
-export async function playlistsClearPlaylistContents(
+export function playlistsClearPlaylistContents(
client: PlexAPICore,
playlistID: number,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.ClearPlaylistContentsResponse,
| errors.ClearPlaylistContentsBadRequest
@@ -46,6 +47,34 @@ export async function playlistsClearPlaylistContents(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ playlistID,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ playlistID: number,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.ClearPlaylistContentsResponse,
+ | errors.ClearPlaylistContentsBadRequest
+ | errors.ClearPlaylistContentsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.ClearPlaylistContentsRequest = {
playlistID: playlistID,
@@ -58,7 +87,7 @@ export async function playlistsClearPlaylistContents(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -81,6 +110,7 @@ export async function playlistsClearPlaylistContents(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "clearPlaylistContents",
oAuth2Scopes: [],
@@ -103,7 +133,7 @@ export async function playlistsClearPlaylistContents(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +144,7 @@ export async function playlistsClearPlaylistContents(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -145,8 +175,8 @@ export async function playlistsClearPlaylistContents(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/playlistsCreatePlaylist.ts b/src/funcs/playlistsCreatePlaylist.ts
index a7a4c2bf..dade7ab1 100644
--- a/src/funcs/playlistsCreatePlaylist.ts
+++ b/src/funcs/playlistsCreatePlaylist.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -31,11 +32,11 @@ import { Result } from "../sdk/types/fp.js";
* - `uri` - The content URI for what we're playing (e.g. `server://1234/com.plexapp.plugins.library/library/metadata/1`).
* - `playQueueID` - To create a playlist from an existing play queue.
*/
-export async function playlistsCreatePlaylist(
+export function playlistsCreatePlaylist(
client: PlexAPICore,
request: operations.CreatePlaylistRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.CreatePlaylistResponse,
| errors.CreatePlaylistBadRequest
@@ -48,6 +49,34 @@ export async function playlistsCreatePlaylist(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.CreatePlaylistRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.CreatePlaylistResponse,
+ | errors.CreatePlaylistBadRequest
+ | errors.CreatePlaylistUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -55,7 +84,7 @@ export async function playlistsCreatePlaylist(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -79,6 +108,7 @@ export async function playlistsCreatePlaylist(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "createPlaylist",
oAuth2Scopes: [],
@@ -102,7 +132,7 @@ export async function playlistsCreatePlaylist(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -113,7 +143,7 @@ export async function playlistsCreatePlaylist(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -146,8 +176,8 @@ export async function playlistsCreatePlaylist(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/playlistsDeletePlaylist.ts b/src/funcs/playlistsDeletePlaylist.ts
index 235df059..391ebc44 100644
--- a/src/funcs/playlistsDeletePlaylist.ts
+++ b/src/funcs/playlistsDeletePlaylist.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This endpoint will delete a playlist
*/
-export async function playlistsDeletePlaylist(
+export function playlistsDeletePlaylist(
client: PlexAPICore,
playlistID: number,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.DeletePlaylistResponse,
| errors.DeletePlaylistBadRequest
@@ -46,6 +47,34 @@ export async function playlistsDeletePlaylist(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ playlistID,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ playlistID: number,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.DeletePlaylistResponse,
+ | errors.DeletePlaylistBadRequest
+ | errors.DeletePlaylistUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.DeletePlaylistRequest = {
playlistID: playlistID,
@@ -57,7 +86,7 @@ export async function playlistsDeletePlaylist(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -80,6 +109,7 @@ export async function playlistsDeletePlaylist(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "deletePlaylist",
oAuth2Scopes: [],
@@ -102,7 +132,7 @@ export async function playlistsDeletePlaylist(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -113,7 +143,7 @@ export async function playlistsDeletePlaylist(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -144,8 +174,8 @@ export async function playlistsDeletePlaylist(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/playlistsGetPlaylist.ts b/src/funcs/playlistsGetPlaylist.ts
index afc3c487..86c3752c 100644
--- a/src/funcs/playlistsGetPlaylist.ts
+++ b/src/funcs/playlistsGetPlaylist.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -30,11 +31,11 @@ import { Result } from "../sdk/types/fp.js";
* Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item:
* Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing.
*/
-export async function playlistsGetPlaylist(
+export function playlistsGetPlaylist(
client: PlexAPICore,
playlistID: number,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetPlaylistResponse,
| errors.GetPlaylistBadRequest
@@ -47,6 +48,34 @@ export async function playlistsGetPlaylist(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ playlistID,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ playlistID: number,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetPlaylistResponse,
+ | errors.GetPlaylistBadRequest
+ | errors.GetPlaylistUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetPlaylistRequest = {
playlistID: playlistID,
@@ -58,7 +87,7 @@ export async function playlistsGetPlaylist(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -81,6 +110,7 @@ export async function playlistsGetPlaylist(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getPlaylist",
oAuth2Scopes: [],
@@ -103,7 +133,7 @@ export async function playlistsGetPlaylist(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +144,7 @@ export async function playlistsGetPlaylist(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -147,8 +177,8 @@ export async function playlistsGetPlaylist(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/playlistsGetPlaylistContents.ts b/src/funcs/playlistsGetPlaylistContents.ts
index 4a86845f..4fa44662 100644
--- a/src/funcs/playlistsGetPlaylistContents.ts
+++ b/src/funcs/playlistsGetPlaylistContents.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -32,12 +33,12 @@ import { Result } from "../sdk/types/fp.js";
* For example, you could use this to display a list of recently added albums vis a smart playlist.
* Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items.
*/
-export async function playlistsGetPlaylistContents(
+export function playlistsGetPlaylistContents(
client: PlexAPICore,
playlistID: number,
type: operations.GetPlaylistContentsQueryParamType,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetPlaylistContentsResponse,
| errors.GetPlaylistContentsBadRequest
@@ -50,6 +51,36 @@ export async function playlistsGetPlaylistContents(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ playlistID,
+ type,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ playlistID: number,
+ type: operations.GetPlaylistContentsQueryParamType,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetPlaylistContentsResponse,
+ | errors.GetPlaylistContentsBadRequest
+ | errors.GetPlaylistContentsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetPlaylistContentsRequest = {
playlistID: playlistID,
@@ -63,7 +94,7 @@ export async function playlistsGetPlaylistContents(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -90,6 +121,7 @@ export async function playlistsGetPlaylistContents(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getPlaylistContents",
oAuth2Scopes: [],
@@ -113,7 +145,7 @@ export async function playlistsGetPlaylistContents(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -124,7 +156,7 @@ export async function playlistsGetPlaylistContents(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -157,8 +189,8 @@ export async function playlistsGetPlaylistContents(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/playlistsGetPlaylists.ts b/src/funcs/playlistsGetPlaylists.ts
index 457081d3..a7cbf2a2 100644
--- a/src/funcs/playlistsGetPlaylists.ts
+++ b/src/funcs/playlistsGetPlaylists.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get All Playlists given the specified filters.
*/
-export async function playlistsGetPlaylists(
+export function playlistsGetPlaylists(
client: PlexAPICore,
playlistType?: operations.PlaylistType | undefined,
smart?: operations.QueryParamSmart | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetPlaylistsResponse,
| errors.GetPlaylistsBadRequest
@@ -47,6 +48,36 @@ export async function playlistsGetPlaylists(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ playlistType,
+ smart,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ playlistType?: operations.PlaylistType | undefined,
+ smart?: operations.QueryParamSmart | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetPlaylistsResponse,
+ | errors.GetPlaylistsBadRequest
+ | errors.GetPlaylistsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetPlaylistsRequest = {
playlistType: playlistType,
@@ -59,7 +90,7 @@ export async function playlistsGetPlaylists(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -80,6 +111,7 @@ export async function playlistsGetPlaylists(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getPlaylists",
oAuth2Scopes: [],
@@ -103,7 +135,7 @@ export async function playlistsGetPlaylists(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +146,7 @@ export async function playlistsGetPlaylists(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -147,8 +179,8 @@ export async function playlistsGetPlaylists(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/playlistsUpdatePlaylist.ts b/src/funcs/playlistsUpdatePlaylist.ts
index d3bf2d7f..dc87823c 100644
--- a/src/funcs/playlistsUpdatePlaylist.ts
+++ b/src/funcs/playlistsUpdatePlaylist.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,13 +30,13 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}`
*/
-export async function playlistsUpdatePlaylist(
+export function playlistsUpdatePlaylist(
client: PlexAPICore,
playlistID: number,
title?: string | undefined,
summary?: string | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.UpdatePlaylistResponse,
| errors.UpdatePlaylistBadRequest
@@ -48,6 +49,38 @@ export async function playlistsUpdatePlaylist(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ playlistID,
+ title,
+ summary,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ playlistID: number,
+ title?: string | undefined,
+ summary?: string | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.UpdatePlaylistResponse,
+ | errors.UpdatePlaylistBadRequest
+ | errors.UpdatePlaylistUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.UpdatePlaylistRequest = {
playlistID: playlistID,
@@ -61,7 +94,7 @@ export async function playlistsUpdatePlaylist(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -89,6 +122,7 @@ export async function playlistsUpdatePlaylist(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "updatePlaylist",
oAuth2Scopes: [],
@@ -112,7 +146,7 @@ export async function playlistsUpdatePlaylist(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -123,7 +157,7 @@ export async function playlistsUpdatePlaylist(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -154,8 +188,8 @@ export async function playlistsUpdatePlaylist(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/playlistsUploadPlaylist.ts b/src/funcs/playlistsUploadPlaylist.ts
index bb845db8..05629eee 100644
--- a/src/funcs/playlistsUploadPlaylist.ts
+++ b/src/funcs/playlistsUploadPlaylist.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,13 +30,13 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file.
*/
-export async function playlistsUploadPlaylist(
+export function playlistsUploadPlaylist(
client: PlexAPICore,
path: string,
force: operations.QueryParamForce,
sectionID: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.UploadPlaylistResponse,
| errors.UploadPlaylistBadRequest
@@ -48,6 +49,38 @@ export async function playlistsUploadPlaylist(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ path,
+ force,
+ sectionID,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ path: string,
+ force: operations.QueryParamForce,
+ sectionID: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.UploadPlaylistResponse,
+ | errors.UploadPlaylistBadRequest
+ | errors.UploadPlaylistUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.UploadPlaylistRequest = {
path: path,
@@ -61,7 +94,7 @@ export async function playlistsUploadPlaylist(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -83,6 +116,7 @@ export async function playlistsUploadPlaylist(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "uploadPlaylist",
oAuth2Scopes: [],
@@ -106,7 +140,7 @@ export async function playlistsUploadPlaylist(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -117,7 +151,7 @@ export async function playlistsUploadPlaylist(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -148,8 +182,8 @@ export async function playlistsUploadPlaylist(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/plexGetCompanionsData.ts b/src/funcs/plexGetCompanionsData.ts
index 235ab74e..a2a2a941 100644
--- a/src/funcs/plexGetCompanionsData.ts
+++ b/src/funcs/plexGetCompanionsData.ts
@@ -20,6 +20,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetCompanionsDataServerList } from "../sdk/models/operations/getcompanionsdata.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -28,10 +29,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Companions Data
*/
-export async function plexGetCompanionsData(
+export function plexGetCompanionsData(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetCompanionsDataResponse,
| errors.GetCompanionsDataBadRequest
@@ -44,6 +45,32 @@ export async function plexGetCompanionsData(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetCompanionsDataResponse,
+ | errors.GetCompanionsDataBadRequest
+ | errors.GetCompanionsDataUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const baseURL = options?.serverURL
|| pathToFunc(GetCompanionsDataServerList[0], {
@@ -61,6 +88,7 @@ export async function plexGetCompanionsData(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: baseURL ?? "",
operationID: "getCompanionsData",
oAuth2Scopes: [],
@@ -82,7 +110,7 @@ export async function plexGetCompanionsData(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -93,7 +121,7 @@ export async function plexGetCompanionsData(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -126,8 +154,8 @@ export async function plexGetCompanionsData(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/plexGetGeoData.ts b/src/funcs/plexGetGeoData.ts
index 04aeeef1..6a7dc942 100644
--- a/src/funcs/plexGetGeoData.ts
+++ b/src/funcs/plexGetGeoData.ts
@@ -19,6 +19,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetGeoDataServerList } from "../sdk/models/operations/getgeodata.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Returns the geolocation and locale data of the caller
*/
-export async function plexGetGeoData(
+export function plexGetGeoData(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetGeoDataResponse,
| errors.GetGeoDataBadRequest
@@ -43,6 +44,32 @@ export async function plexGetGeoData(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetGeoDataResponse,
+ | errors.GetGeoDataBadRequest
+ | errors.GetGeoDataUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const baseURL = options?.serverURL
|| pathToFunc(GetGeoDataServerList[0], { charEncoding: "percent" })();
@@ -54,6 +81,7 @@ export async function plexGetGeoData(
}));
const context = {
+ baseURL: baseURL ?? "",
operationID: "getGeoData",
oAuth2Scopes: [],
@@ -74,7 +102,7 @@ export async function plexGetGeoData(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -85,7 +113,7 @@ export async function plexGetGeoData(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -118,8 +146,8 @@ export async function plexGetGeoData(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/plexGetHomeData.ts b/src/funcs/plexGetHomeData.ts
index b63cdb41..23965d53 100644
--- a/src/funcs/plexGetHomeData.ts
+++ b/src/funcs/plexGetHomeData.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status.
*/
-export async function plexGetHomeData(
+export function plexGetHomeData(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetHomeDataResponse,
| errors.GetHomeDataBadRequest
@@ -43,6 +44,32 @@ export async function plexGetHomeData(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetHomeDataResponse,
+ | errors.GetHomeDataBadRequest
+ | errors.GetHomeDataUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/home")();
@@ -55,6 +82,7 @@ export async function plexGetHomeData(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getHomeData",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function plexGetHomeData(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function plexGetHomeData(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function plexGetHomeData(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/plexGetPin.ts b/src/funcs/plexGetPin.ts
index cbcace46..d3205cdf 100644
--- a/src/funcs/plexGetPin.ts
+++ b/src/funcs/plexGetPin.ts
@@ -21,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetPinServerList } from "../sdk/models/operations/getpin.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Retrieve a Pin ID from Plex.tv to use for authentication flows
*/
-export async function plexGetPin(
+export function plexGetPin(
client: PlexAPICore,
request: operations.GetPinRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetPinResponse,
| errors.GetPinBadRequest
@@ -45,6 +46,33 @@ export async function plexGetPin(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetPinRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetPinResponse,
+ | errors.GetPinBadRequest
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -52,7 +80,7 @@ export async function plexGetPin(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -92,6 +120,7 @@ export async function plexGetPin(
}));
const context = {
+ baseURL: baseURL ?? "",
operationID: "getPin",
oAuth2Scopes: [],
@@ -114,7 +143,7 @@ export async function plexGetPin(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -125,7 +154,7 @@ export async function plexGetPin(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -156,8 +185,8 @@ export async function plexGetPin(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/plexGetServerResources.ts b/src/funcs/plexGetServerResources.ts
index 1b637dd0..2528e839 100644
--- a/src/funcs/plexGetServerResources.ts
+++ b/src/funcs/plexGetServerResources.ts
@@ -22,6 +22,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetServerResourcesServerList } from "../sdk/models/operations/getserverresources.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -30,14 +31,14 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Plex server access tokens and server connections
*/
-export async function plexGetServerResources(
+export function plexGetServerResources(
client: PlexAPICore,
clientID: string,
includeHttps?: operations.IncludeHttps | undefined,
includeRelay?: operations.IncludeRelay | undefined,
includeIPv6?: operations.IncludeIPv6 | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetServerResourcesResponse,
| errors.GetServerResourcesBadRequest
@@ -50,6 +51,40 @@ export async function plexGetServerResources(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ clientID,
+ includeHttps,
+ includeRelay,
+ includeIPv6,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ clientID: string,
+ includeHttps?: operations.IncludeHttps | undefined,
+ includeRelay?: operations.IncludeRelay | undefined,
+ includeIPv6?: operations.IncludeIPv6 | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetServerResourcesResponse,
+ | errors.GetServerResourcesBadRequest
+ | errors.GetServerResourcesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetServerResourcesRequest = {
clientID: clientID,
@@ -64,7 +99,7 @@ export async function plexGetServerResources(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -96,6 +131,7 @@ export async function plexGetServerResources(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: baseURL ?? "",
operationID: "get-server-resources",
oAuth2Scopes: [],
@@ -119,7 +155,7 @@ export async function plexGetServerResources(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -130,7 +166,7 @@ export async function plexGetServerResources(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -163,8 +199,8 @@ export async function plexGetServerResources(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/plexGetTokenByPinId.ts b/src/funcs/plexGetTokenByPinId.ts
index c3e7aa52..5e3ffac2 100644
--- a/src/funcs/plexGetTokenByPinId.ts
+++ b/src/funcs/plexGetTokenByPinId.ts
@@ -21,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetTokenByPinIdServerList } from "../sdk/models/operations/gettokenbypinid.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Retrieve an Access Token from Plex.tv after the Pin has been authenticated
*/
-export async function plexGetTokenByPinId(
+export function plexGetTokenByPinId(
client: PlexAPICore,
request: operations.GetTokenByPinIdRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetTokenByPinIdResponse,
| errors.GetTokenByPinIdBadRequest
@@ -46,6 +47,34 @@ export async function plexGetTokenByPinId(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetTokenByPinIdRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetTokenByPinIdResponse,
+ | errors.GetTokenByPinIdBadRequest
+ | errors.GetTokenByPinIdResponseBody
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -53,7 +82,7 @@ export async function plexGetTokenByPinId(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -96,6 +125,7 @@ export async function plexGetTokenByPinId(
}));
const context = {
+ baseURL: baseURL ?? "",
operationID: "getTokenByPinId",
oAuth2Scopes: [],
@@ -117,7 +147,7 @@ export async function plexGetTokenByPinId(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -128,7 +158,7 @@ export async function plexGetTokenByPinId(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -161,8 +191,8 @@ export async function plexGetTokenByPinId(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/plexGetUserFriends.ts b/src/funcs/plexGetUserFriends.ts
index 4dd31421..9ba7369d 100644
--- a/src/funcs/plexGetUserFriends.ts
+++ b/src/funcs/plexGetUserFriends.ts
@@ -20,6 +20,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetUserFriendsServerList } from "../sdk/models/operations/getuserfriends.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -28,10 +29,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get friends of provided auth token.
*/
-export async function plexGetUserFriends(
+export function plexGetUserFriends(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetUserFriendsResponse,
| errors.GetUserFriendsBadRequest
@@ -44,6 +45,32 @@ export async function plexGetUserFriends(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetUserFriendsResponse,
+ | errors.GetUserFriendsBadRequest
+ | errors.GetUserFriendsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const baseURL = options?.serverURL
|| pathToFunc(GetUserFriendsServerList[0], { charEncoding: "percent" })();
@@ -59,6 +86,7 @@ export async function plexGetUserFriends(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: baseURL ?? "",
operationID: "getUserFriends",
oAuth2Scopes: [],
@@ -80,7 +108,7 @@ export async function plexGetUserFriends(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -91,7 +119,7 @@ export async function plexGetUserFriends(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -124,8 +152,8 @@ export async function plexGetUserFriends(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/searchGetSearchResults.ts b/src/funcs/searchGetSearchResults.ts
index adcf62ec..caaa5af2 100644
--- a/src/funcs/searchGetSearchResults.ts
+++ b/src/funcs/searchGetSearchResults.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This will search the database for the string provided.
*/
-export async function searchGetSearchResults(
+export function searchGetSearchResults(
client: PlexAPICore,
query: string,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetSearchResultsResponse,
| errors.GetSearchResultsBadRequest
@@ -46,6 +47,34 @@ export async function searchGetSearchResults(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ query,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ query: string,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetSearchResultsResponse,
+ | errors.GetSearchResultsBadRequest
+ | errors.GetSearchResultsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetSearchResultsRequest = {
query: query,
@@ -57,7 +86,7 @@ export async function searchGetSearchResults(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -77,6 +106,7 @@ export async function searchGetSearchResults(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getSearchResults",
oAuth2Scopes: [],
@@ -100,7 +130,7 @@ export async function searchGetSearchResults(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -111,7 +141,7 @@ export async function searchGetSearchResults(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -144,8 +174,8 @@ export async function searchGetSearchResults(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/searchPerformSearch.ts b/src/funcs/searchPerformSearch.ts
index fcf82066..ff93e7b1 100644
--- a/src/funcs/searchPerformSearch.ts
+++ b/src/funcs/searchPerformSearch.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -40,13 +41,13 @@ import { Result } from "../sdk/types/fp.js";
*
* This request is intended to be very fast, and called as the user types.
*/
-export async function searchPerformSearch(
+export function searchPerformSearch(
client: PlexAPICore,
query: string,
sectionId?: number | undefined,
limit?: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.PerformSearchResponse,
| errors.PerformSearchBadRequest
@@ -59,6 +60,38 @@ export async function searchPerformSearch(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ query,
+ sectionId,
+ limit,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ query: string,
+ sectionId?: number | undefined,
+ limit?: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.PerformSearchResponse,
+ | errors.PerformSearchBadRequest
+ | errors.PerformSearchUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.PerformSearchRequest = {
query: query,
@@ -72,7 +105,7 @@ export async function searchPerformSearch(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -94,6 +127,7 @@ export async function searchPerformSearch(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "performSearch",
oAuth2Scopes: [],
@@ -117,7 +151,7 @@ export async function searchPerformSearch(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -128,7 +162,7 @@ export async function searchPerformSearch(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -159,8 +193,8 @@ export async function searchPerformSearch(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/searchPerformVoiceSearch.ts b/src/funcs/searchPerformVoiceSearch.ts
index 423eb79b..3d497611 100644
--- a/src/funcs/searchPerformVoiceSearch.ts
+++ b/src/funcs/searchPerformVoiceSearch.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -32,13 +33,13 @@ import { Result } from "../sdk/types/fp.js";
* Whenever possible, clients should limit the search to the appropriate type.
* Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality.
*/
-export async function searchPerformVoiceSearch(
+export function searchPerformVoiceSearch(
client: PlexAPICore,
query: string,
sectionId?: number | undefined,
limit?: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.PerformVoiceSearchResponse,
| errors.PerformVoiceSearchBadRequest
@@ -51,6 +52,38 @@ export async function searchPerformVoiceSearch(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ query,
+ sectionId,
+ limit,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ query: string,
+ sectionId?: number | undefined,
+ limit?: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.PerformVoiceSearchResponse,
+ | errors.PerformVoiceSearchBadRequest
+ | errors.PerformVoiceSearchUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.PerformVoiceSearchRequest = {
query: query,
@@ -64,7 +97,7 @@ export async function searchPerformVoiceSearch(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -86,6 +119,7 @@ export async function searchPerformVoiceSearch(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "performVoiceSearch",
oAuth2Scopes: [],
@@ -109,7 +143,7 @@ export async function searchPerformVoiceSearch(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -120,7 +154,7 @@ export async function searchPerformVoiceSearch(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -151,8 +185,8 @@ export async function searchPerformVoiceSearch(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/serverGetAvailableClients.ts b/src/funcs/serverGetAvailableClients.ts
index bb4a7282..d5b0faff 100644
--- a/src/funcs/serverGetAvailableClients.ts
+++ b/src/funcs/serverGetAvailableClients.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Available Clients
*/
-export async function serverGetAvailableClients(
+export function serverGetAvailableClients(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetAvailableClientsResponse,
| errors.GetAvailableClientsBadRequest
@@ -43,6 +44,32 @@ export async function serverGetAvailableClients(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetAvailableClientsResponse,
+ | errors.GetAvailableClientsBadRequest
+ | errors.GetAvailableClientsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/clients")();
@@ -55,6 +82,7 @@ export async function serverGetAvailableClients(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getAvailableClients",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function serverGetAvailableClients(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function serverGetAvailableClients(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function serverGetAvailableClients(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/serverGetDevices.ts b/src/funcs/serverGetDevices.ts
index 885bd779..78e3b574 100644
--- a/src/funcs/serverGetDevices.ts
+++ b/src/funcs/serverGetDevices.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Devices
*/
-export async function serverGetDevices(
+export function serverGetDevices(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetDevicesResponse,
| errors.GetDevicesBadRequest
@@ -43,6 +44,32 @@ export async function serverGetDevices(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetDevicesResponse,
+ | errors.GetDevicesBadRequest
+ | errors.GetDevicesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/devices")();
@@ -55,6 +82,7 @@ export async function serverGetDevices(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getDevices",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function serverGetDevices(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function serverGetDevices(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -118,8 +146,8 @@ export async function serverGetDevices(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/serverGetMediaProviders.ts b/src/funcs/serverGetMediaProviders.ts
index bd7a8a53..fc27cb82 100644
--- a/src/funcs/serverGetMediaProviders.ts
+++ b/src/funcs/serverGetMediaProviders.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Retrieves media providers and their features from the Plex server.
*/
-export async function serverGetMediaProviders(
+export function serverGetMediaProviders(
client: PlexAPICore,
xPlexToken: string,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetMediaProvidersResponse,
| errors.GetMediaProvidersBadRequest
@@ -46,6 +47,34 @@ export async function serverGetMediaProviders(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ xPlexToken,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ xPlexToken: string,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetMediaProvidersResponse,
+ | errors.GetMediaProvidersBadRequest
+ | errors.GetMediaProvidersUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetMediaProvidersRequest = {
xPlexToken: xPlexToken,
@@ -57,7 +86,7 @@ export async function serverGetMediaProviders(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -77,6 +106,7 @@ export async function serverGetMediaProviders(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-media-providers",
oAuth2Scopes: [],
@@ -99,7 +129,7 @@ export async function serverGetMediaProviders(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -110,7 +140,7 @@ export async function serverGetMediaProviders(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -143,8 +173,8 @@ export async function serverGetMediaProviders(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/serverGetMyPlexAccount.ts b/src/funcs/serverGetMyPlexAccount.ts
index ec49056c..ea038c81 100644
--- a/src/funcs/serverGetMyPlexAccount.ts
+++ b/src/funcs/serverGetMyPlexAccount.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Returns MyPlex Account Information
*/
-export async function serverGetMyPlexAccount(
+export function serverGetMyPlexAccount(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetMyPlexAccountResponse,
| errors.GetMyPlexAccountBadRequest
@@ -43,6 +44,32 @@ export async function serverGetMyPlexAccount(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetMyPlexAccountResponse,
+ | errors.GetMyPlexAccountBadRequest
+ | errors.GetMyPlexAccountUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/myplex/account")();
@@ -55,6 +82,7 @@ export async function serverGetMyPlexAccount(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getMyPlexAccount",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function serverGetMyPlexAccount(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function serverGetMyPlexAccount(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function serverGetMyPlexAccount(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/serverGetResizedPhoto.ts b/src/funcs/serverGetResizedPhoto.ts
index 18a840cf..7cfda5d6 100644
--- a/src/funcs/serverGetResizedPhoto.ts
+++ b/src/funcs/serverGetResizedPhoto.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
*/
-export async function serverGetResizedPhoto(
+export function serverGetResizedPhoto(
client: PlexAPICore,
request: operations.GetResizedPhotoRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetResizedPhotoResponse,
| errors.GetResizedPhotoBadRequest
@@ -46,6 +47,34 @@ export async function serverGetResizedPhoto(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetResizedPhotoRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetResizedPhotoResponse,
+ | errors.GetResizedPhotoBadRequest
+ | errors.GetResizedPhotoUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -53,7 +82,7 @@ export async function serverGetResizedPhoto(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -79,6 +108,7 @@ export async function serverGetResizedPhoto(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getResizedPhoto",
oAuth2Scopes: [],
@@ -102,7 +132,7 @@ export async function serverGetResizedPhoto(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -113,7 +143,7 @@ export async function serverGetResizedPhoto(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -144,8 +174,8 @@ export async function serverGetResizedPhoto(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/serverGetServerCapabilities.ts b/src/funcs/serverGetServerCapabilities.ts
index 97226421..198dc6ef 100644
--- a/src/funcs/serverGetServerCapabilities.ts
+++ b/src/funcs/serverGetServerCapabilities.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Server Capabilities
*/
-export async function serverGetServerCapabilities(
+export function serverGetServerCapabilities(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetServerCapabilitiesResponse,
| errors.GetServerCapabilitiesBadRequest
@@ -43,6 +44,32 @@ export async function serverGetServerCapabilities(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetServerCapabilitiesResponse,
+ | errors.GetServerCapabilitiesBadRequest
+ | errors.GetServerCapabilitiesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/")();
@@ -55,6 +82,7 @@ export async function serverGetServerCapabilities(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getServerCapabilities",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function serverGetServerCapabilities(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function serverGetServerCapabilities(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function serverGetServerCapabilities(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/serverGetServerIdentity.ts b/src/funcs/serverGetServerIdentity.ts
index 61210d07..86463d71 100644
--- a/src/funcs/serverGetServerIdentity.ts
+++ b/src/funcs/serverGetServerIdentity.ts
@@ -18,6 +18,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -26,10 +27,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This request is useful to determine if the server is online or offline
*/
-export async function serverGetServerIdentity(
+export function serverGetServerIdentity(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetServerIdentityResponse,
| errors.GetServerIdentityRequestTimeout
@@ -41,6 +42,31 @@ export async function serverGetServerIdentity(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetServerIdentityResponse,
+ | errors.GetServerIdentityRequestTimeout
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/identity")();
@@ -49,6 +75,7 @@ export async function serverGetServerIdentity(
}));
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "get-server-identity",
oAuth2Scopes: [],
@@ -69,7 +96,7 @@ export async function serverGetServerIdentity(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -80,7 +107,7 @@ export async function serverGetServerIdentity(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -111,8 +138,8 @@ export async function serverGetServerIdentity(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/serverGetServerList.ts b/src/funcs/serverGetServerList.ts
index f0faa35e..9a618606 100644
--- a/src/funcs/serverGetServerList.ts
+++ b/src/funcs/serverGetServerList.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Server List
*/
-export async function serverGetServerList(
+export function serverGetServerList(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetServerListResponse,
| errors.GetServerListBadRequest
@@ -43,6 +44,32 @@ export async function serverGetServerList(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetServerListResponse,
+ | errors.GetServerListBadRequest
+ | errors.GetServerListUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/servers")();
@@ -55,6 +82,7 @@ export async function serverGetServerList(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getServerList",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function serverGetServerList(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function serverGetServerList(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function serverGetServerList(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/serverGetServerPreferences.ts b/src/funcs/serverGetServerPreferences.ts
index b9a1c43d..14699fc9 100644
--- a/src/funcs/serverGetServerPreferences.ts
+++ b/src/funcs/serverGetServerPreferences.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Server Preferences
*/
-export async function serverGetServerPreferences(
+export function serverGetServerPreferences(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetServerPreferencesResponse,
| errors.GetServerPreferencesBadRequest
@@ -43,6 +44,32 @@ export async function serverGetServerPreferences(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetServerPreferencesResponse,
+ | errors.GetServerPreferencesBadRequest
+ | errors.GetServerPreferencesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/:/prefs")();
@@ -55,6 +82,7 @@ export async function serverGetServerPreferences(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getServerPreferences",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function serverGetServerPreferences(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function serverGetServerPreferences(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function serverGetServerPreferences(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/sessionsGetSessionHistory.ts b/src/funcs/sessionsGetSessionHistory.ts
index 159224e0..bf44996a 100644
--- a/src/funcs/sessionsGetSessionHistory.ts
+++ b/src/funcs/sessionsGetSessionHistory.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,14 +30,14 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This will Retrieve a listing of all history views.
*/
-export async function sessionsGetSessionHistory(
+export function sessionsGetSessionHistory(
client: PlexAPICore,
sort?: string | undefined,
accountId?: number | undefined,
filter?: operations.QueryParamFilter | undefined,
librarySectionID?: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetSessionHistoryResponse,
| errors.GetSessionHistoryBadRequest
@@ -49,6 +50,40 @@ export async function sessionsGetSessionHistory(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sort,
+ accountId,
+ filter,
+ librarySectionID,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sort?: string | undefined,
+ accountId?: number | undefined,
+ filter?: operations.QueryParamFilter | undefined,
+ librarySectionID?: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetSessionHistoryResponse,
+ | errors.GetSessionHistoryBadRequest
+ | errors.GetSessionHistoryUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetSessionHistoryRequest = {
sort: sort,
@@ -63,7 +98,7 @@ export async function sessionsGetSessionHistory(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -86,6 +121,7 @@ export async function sessionsGetSessionHistory(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getSessionHistory",
oAuth2Scopes: [],
@@ -109,7 +145,7 @@ export async function sessionsGetSessionHistory(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -120,7 +156,7 @@ export async function sessionsGetSessionHistory(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -153,8 +189,8 @@ export async function sessionsGetSessionHistory(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/sessionsGetSessions.ts b/src/funcs/sessionsGetSessions.ts
index 6fa8c746..bd8430ba 100644
--- a/src/funcs/sessionsGetSessions.ts
+++ b/src/funcs/sessionsGetSessions.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This will retrieve the "Now Playing" Information of the PMS.
*/
-export async function sessionsGetSessions(
+export function sessionsGetSessions(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetSessionsResponse,
| errors.GetSessionsBadRequest
@@ -43,6 +44,32 @@ export async function sessionsGetSessions(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetSessionsResponse,
+ | errors.GetSessionsBadRequest
+ | errors.GetSessionsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/status/sessions")();
@@ -55,6 +82,7 @@ export async function sessionsGetSessions(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getSessions",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function sessionsGetSessions(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function sessionsGetSessions(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function sessionsGetSessions(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/sessionsGetTranscodeSessions.ts b/src/funcs/sessionsGetTranscodeSessions.ts
index 0b15e620..ef2cd51f 100644
--- a/src/funcs/sessionsGetTranscodeSessions.ts
+++ b/src/funcs/sessionsGetTranscodeSessions.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get Transcode Sessions
*/
-export async function sessionsGetTranscodeSessions(
+export function sessionsGetTranscodeSessions(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetTranscodeSessionsResponse,
| errors.GetTranscodeSessionsBadRequest
@@ -43,6 +44,32 @@ export async function sessionsGetTranscodeSessions(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetTranscodeSessionsResponse,
+ | errors.GetTranscodeSessionsBadRequest
+ | errors.GetTranscodeSessionsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/transcode/sessions")();
@@ -55,6 +82,7 @@ export async function sessionsGetTranscodeSessions(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getTranscodeSessions",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function sessionsGetTranscodeSessions(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function sessionsGetTranscodeSessions(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function sessionsGetTranscodeSessions(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/sessionsStopTranscodeSession.ts b/src/funcs/sessionsStopTranscodeSession.ts
index c7579a4c..7a6098d7 100644
--- a/src/funcs/sessionsStopTranscodeSession.ts
+++ b/src/funcs/sessionsStopTranscodeSession.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Stop a Transcode Session
*/
-export async function sessionsStopTranscodeSession(
+export function sessionsStopTranscodeSession(
client: PlexAPICore,
sessionKey: string,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.StopTranscodeSessionResponse,
| errors.StopTranscodeSessionBadRequest
@@ -46,6 +47,34 @@ export async function sessionsStopTranscodeSession(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ sessionKey,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ sessionKey: string,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.StopTranscodeSessionResponse,
+ | errors.StopTranscodeSessionBadRequest
+ | errors.StopTranscodeSessionUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.StopTranscodeSessionRequest = {
sessionKey: sessionKey,
@@ -58,7 +87,7 @@ export async function sessionsStopTranscodeSession(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -81,6 +110,7 @@ export async function sessionsStopTranscodeSession(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "stopTranscodeSession",
oAuth2Scopes: [],
@@ -103,7 +133,7 @@ export async function sessionsStopTranscodeSession(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +144,7 @@ export async function sessionsStopTranscodeSession(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -145,8 +175,8 @@ export async function sessionsStopTranscodeSession(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/statisticsGetBandwidthStatistics.ts b/src/funcs/statisticsGetBandwidthStatistics.ts
index 58ccd1e3..e0b423c8 100644
--- a/src/funcs/statisticsGetBandwidthStatistics.ts
+++ b/src/funcs/statisticsGetBandwidthStatistics.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This will return the bandwidth statistics for the server
*/
-export async function statisticsGetBandwidthStatistics(
+export function statisticsGetBandwidthStatistics(
client: PlexAPICore,
timespan?: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetBandwidthStatisticsResponse,
| errors.GetBandwidthStatisticsBadRequest
@@ -46,6 +47,34 @@ export async function statisticsGetBandwidthStatistics(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ timespan,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ timespan?: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetBandwidthStatisticsResponse,
+ | errors.GetBandwidthStatisticsBadRequest
+ | errors.GetBandwidthStatisticsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetBandwidthStatisticsRequest = {
timespan: timespan,
@@ -58,7 +87,7 @@ export async function statisticsGetBandwidthStatistics(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -78,6 +107,7 @@ export async function statisticsGetBandwidthStatistics(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getBandwidthStatistics",
oAuth2Scopes: [],
@@ -101,7 +131,7 @@ export async function statisticsGetBandwidthStatistics(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -112,7 +142,7 @@ export async function statisticsGetBandwidthStatistics(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -145,8 +175,8 @@ export async function statisticsGetBandwidthStatistics(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/statisticsGetResourcesStatistics.ts b/src/funcs/statisticsGetResourcesStatistics.ts
index 8f1486a0..f491848e 100644
--- a/src/funcs/statisticsGetResourcesStatistics.ts
+++ b/src/funcs/statisticsGetResourcesStatistics.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This will return the resources for the server
*/
-export async function statisticsGetResourcesStatistics(
+export function statisticsGetResourcesStatistics(
client: PlexAPICore,
timespan?: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetResourcesStatisticsResponse,
| errors.GetResourcesStatisticsBadRequest
@@ -46,6 +47,34 @@ export async function statisticsGetResourcesStatistics(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ timespan,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ timespan?: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetResourcesStatisticsResponse,
+ | errors.GetResourcesStatisticsBadRequest
+ | errors.GetResourcesStatisticsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetResourcesStatisticsRequest = {
timespan: timespan,
@@ -58,7 +87,7 @@ export async function statisticsGetResourcesStatistics(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -78,6 +107,7 @@ export async function statisticsGetResourcesStatistics(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getResourcesStatistics",
oAuth2Scopes: [],
@@ -101,7 +131,7 @@ export async function statisticsGetResourcesStatistics(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -112,7 +142,7 @@ export async function statisticsGetResourcesStatistics(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -145,8 +175,8 @@ export async function statisticsGetResourcesStatistics(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/statisticsGetStatistics.ts b/src/funcs/statisticsGetStatistics.ts
index 1c91b7db..7007e28b 100644
--- a/src/funcs/statisticsGetStatistics.ts
+++ b/src/funcs/statisticsGetStatistics.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* This will return the media statistics for the server
*/
-export async function statisticsGetStatistics(
+export function statisticsGetStatistics(
client: PlexAPICore,
timespan?: number | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetStatisticsResponse,
| errors.GetStatisticsBadRequest
@@ -46,6 +47,34 @@ export async function statisticsGetStatistics(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ timespan,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ timespan?: number | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetStatisticsResponse,
+ | errors.GetStatisticsBadRequest
+ | errors.GetStatisticsUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.GetStatisticsRequest = {
timespan: timespan,
@@ -57,7 +86,7 @@ export async function statisticsGetStatistics(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -77,6 +106,7 @@ export async function statisticsGetStatistics(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getStatistics",
oAuth2Scopes: [],
@@ -100,7 +130,7 @@ export async function statisticsGetStatistics(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -111,7 +141,7 @@ export async function statisticsGetStatistics(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -144,8 +174,8 @@ export async function statisticsGetStatistics(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/updaterApplyUpdates.ts b/src/funcs/updaterApplyUpdates.ts
index f7452c43..da4a4636 100644
--- a/src/funcs/updaterApplyUpdates.ts
+++ b/src/funcs/updaterApplyUpdates.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,12 +30,12 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed
*/
-export async function updaterApplyUpdates(
+export function updaterApplyUpdates(
client: PlexAPICore,
tonight?: operations.Tonight | undefined,
skip?: operations.Skip | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.ApplyUpdatesResponse,
| errors.ApplyUpdatesBadRequest
@@ -47,6 +48,36 @@ export async function updaterApplyUpdates(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ tonight,
+ skip,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ tonight?: operations.Tonight | undefined,
+ skip?: operations.Skip | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.ApplyUpdatesResponse,
+ | errors.ApplyUpdatesBadRequest
+ | errors.ApplyUpdatesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.ApplyUpdatesRequest = {
tonight: tonight,
@@ -59,7 +90,7 @@ export async function updaterApplyUpdates(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -80,6 +111,7 @@ export async function updaterApplyUpdates(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "applyUpdates",
oAuth2Scopes: [],
@@ -103,7 +135,7 @@ export async function updaterApplyUpdates(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -114,7 +146,7 @@ export async function updaterApplyUpdates(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -145,8 +177,8 @@ export async function updaterApplyUpdates(
M.fail([500, "5XX"]),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/updaterCheckForUpdates.ts b/src/funcs/updaterCheckForUpdates.ts
index cd74527a..0363e6fc 100644
--- a/src/funcs/updaterCheckForUpdates.ts
+++ b/src/funcs/updaterCheckForUpdates.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Checking for updates
*/
-export async function updaterCheckForUpdates(
+export function updaterCheckForUpdates(
client: PlexAPICore,
download?: operations.Download | undefined,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.CheckForUpdatesResponse,
| errors.CheckForUpdatesBadRequest
@@ -46,6 +47,34 @@ export async function updaterCheckForUpdates(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ download,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ download?: operations.Download | undefined,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.CheckForUpdatesResponse,
+ | errors.CheckForUpdatesBadRequest
+ | errors.CheckForUpdatesUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const input: operations.CheckForUpdatesRequest = {
download: download,
@@ -57,7 +86,7 @@ export async function updaterCheckForUpdates(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -77,6 +106,7 @@ export async function updaterCheckForUpdates(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "checkForUpdates",
oAuth2Scopes: [],
@@ -100,7 +130,7 @@ export async function updaterCheckForUpdates(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -111,7 +141,7 @@ export async function updaterCheckForUpdates(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -142,8 +172,8 @@ export async function updaterCheckForUpdates(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/updaterGetUpdateStatus.ts b/src/funcs/updaterGetUpdateStatus.ts
index 426690c9..3091841a 100644
--- a/src/funcs/updaterGetUpdateStatus.ts
+++ b/src/funcs/updaterGetUpdateStatus.ts
@@ -19,6 +19,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -27,10 +28,10 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Querying status of updates
*/
-export async function updaterGetUpdateStatus(
+export function updaterGetUpdateStatus(
client: PlexAPICore,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetUpdateStatusResponse,
| errors.GetUpdateStatusBadRequest
@@ -43,6 +44,32 @@ export async function updaterGetUpdateStatus(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetUpdateStatusResponse,
+ | errors.GetUpdateStatusBadRequest
+ | errors.GetUpdateStatusUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const path = pathToFunc("/updater/status")();
@@ -55,6 +82,7 @@ export async function updaterGetUpdateStatus(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getUpdateStatus",
oAuth2Scopes: [],
@@ -76,7 +104,7 @@ export async function updaterGetUpdateStatus(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -87,7 +115,7 @@ export async function updaterGetUpdateStatus(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -120,8 +148,8 @@ export async function updaterGetUpdateStatus(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/usersGetUsers.ts b/src/funcs/usersGetUsers.ts
index b924a53f..ea63437d 100644
--- a/src/funcs/usersGetUsers.ts
+++ b/src/funcs/usersGetUsers.ts
@@ -21,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetUsersServerList } from "../sdk/models/operations/getusers.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get list of all users that are friends and have library access with the provided Plex authentication token
*/
-export async function usersGetUsers(
+export function usersGetUsers(
client: PlexAPICore,
request: operations.GetUsersRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetUsersResponse,
| errors.GetUsersBadRequest
@@ -46,6 +47,34 @@ export async function usersGetUsers(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetUsersRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetUsersResponse,
+ | errors.GetUsersBadRequest
+ | errors.GetUsersUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -53,7 +82,7 @@ export async function usersGetUsers(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -126,6 +155,7 @@ export async function usersGetUsers(
}));
const context = {
+ baseURL: baseURL ?? "",
operationID: "get-users",
oAuth2Scopes: [],
@@ -147,7 +177,7 @@ export async function usersGetUsers(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -158,7 +188,7 @@ export async function usersGetUsers(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -192,8 +222,8 @@ export async function usersGetUsers(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/videoGetTimeline.ts b/src/funcs/videoGetTimeline.ts
index 00f2e42f..a37b0c78 100644
--- a/src/funcs/videoGetTimeline.ts
+++ b/src/funcs/videoGetTimeline.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get the timeline for a media item
*/
-export async function videoGetTimeline(
+export function videoGetTimeline(
client: PlexAPICore,
request: operations.GetTimelineRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetTimelineResponse,
| errors.GetTimelineBadRequest
@@ -46,6 +47,34 @@ export async function videoGetTimeline(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetTimelineRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetTimelineResponse,
+ | errors.GetTimelineBadRequest
+ | errors.GetTimelineUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -53,7 +82,7 @@ export async function videoGetTimeline(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -82,6 +111,7 @@ export async function videoGetTimeline(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "getTimeline",
oAuth2Scopes: [],
@@ -105,7 +135,7 @@ export async function videoGetTimeline(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -116,7 +146,7 @@ export async function videoGetTimeline(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -147,8 +177,8 @@ export async function videoGetTimeline(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/videoStartUniversalTranscode.ts b/src/funcs/videoStartUniversalTranscode.ts
index cfd96959..686be502 100644
--- a/src/funcs/videoStartUniversalTranscode.ts
+++ b/src/funcs/videoStartUniversalTranscode.ts
@@ -21,6 +21,7 @@ import * as errors from "../sdk/models/errors/index.js";
import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -29,11 +30,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Begin a Universal Transcode Session
*/
-export async function videoStartUniversalTranscode(
+export function videoStartUniversalTranscode(
client: PlexAPICore,
request: operations.StartUniversalTranscodeRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.StartUniversalTranscodeResponse,
| errors.StartUniversalTranscodeBadRequest
@@ -46,6 +47,34 @@ export async function videoStartUniversalTranscode(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.StartUniversalTranscodeRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.StartUniversalTranscodeResponse,
+ | errors.StartUniversalTranscodeBadRequest
+ | errors.StartUniversalTranscodeUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -54,7 +83,7 @@ export async function videoStartUniversalTranscode(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -89,6 +118,7 @@ export async function videoStartUniversalTranscode(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
operationID: "startUniversalTranscode",
oAuth2Scopes: [],
@@ -112,7 +142,7 @@ export async function videoStartUniversalTranscode(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -123,7 +153,7 @@ export async function videoStartUniversalTranscode(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -154,8 +184,8 @@ export async function videoStartUniversalTranscode(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/funcs/watchlistGetWatchList.ts b/src/funcs/watchlistGetWatchList.ts
index 9140f7a5..65c476e6 100644
--- a/src/funcs/watchlistGetWatchList.ts
+++ b/src/funcs/watchlistGetWatchList.ts
@@ -22,6 +22,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js";
import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js";
import { GetWatchListServerList } from "../sdk/models/operations/getwatchlist.js";
import * as operations from "../sdk/models/operations/index.js";
+import { APICall, APIPromise } from "../sdk/types/async.js";
import { Result } from "../sdk/types/fp.js";
/**
@@ -30,11 +31,11 @@ import { Result } from "../sdk/types/fp.js";
* @remarks
* Get User Watchlist
*/
-export async function watchlistGetWatchList(
+export function watchlistGetWatchList(
client: PlexAPICore,
request: operations.GetWatchListRequest,
options?: RequestOptions,
-): Promise<
+): APIPromise<
Result<
operations.GetWatchListResponse,
| errors.GetWatchListBadRequest
@@ -47,6 +48,34 @@ export async function watchlistGetWatchList(
| RequestTimeoutError
| ConnectionError
>
+> {
+ return new APIPromise($do(
+ client,
+ request,
+ options,
+ ));
+}
+
+async function $do(
+ client: PlexAPICore,
+ request: operations.GetWatchListRequest,
+ options?: RequestOptions,
+): Promise<
+ [
+ Result<
+ operations.GetWatchListResponse,
+ | errors.GetWatchListBadRequest
+ | errors.GetWatchListUnauthorized
+ | SDKError
+ | SDKValidationError
+ | UnexpectedClientError
+ | InvalidRequestError
+ | RequestAbortedError
+ | RequestTimeoutError
+ | ConnectionError
+ >,
+ APICall,
+ ]
> {
const parsed = safeParse(
request,
@@ -54,7 +83,7 @@ export async function watchlistGetWatchList(
"Input validation failed",
);
if (!parsed.ok) {
- return parsed;
+ return [parsed, { status: "invalid" }];
}
const payload = parsed.value;
const body = null;
@@ -94,6 +123,7 @@ export async function watchlistGetWatchList(
const requestSecurity = resolveGlobalSecurity(securityInput);
const context = {
+ baseURL: baseURL ?? "",
operationID: "get-watch-list",
oAuth2Scopes: [],
@@ -117,7 +147,7 @@ export async function watchlistGetWatchList(
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
}, options);
if (!requestRes.ok) {
- return requestRes;
+ return [requestRes, { status: "invalid" }];
}
const req = requestRes.value;
@@ -128,7 +158,7 @@ export async function watchlistGetWatchList(
retryCodes: context.retryCodes,
});
if (!doResult.ok) {
- return doResult;
+ return [doResult, { status: "request-error", request: req }];
}
const response = doResult.value;
@@ -161,8 +191,8 @@ export async function watchlistGetWatchList(
M.fail("5XX"),
)(response, { extraFields: responseFields });
if (!result.ok) {
- return result;
+ return [result, { status: "complete", request: req, response }];
}
- return result;
+ return [result, { status: "complete", request: req, response }];
}
diff --git a/src/hooks/types.ts b/src/hooks/types.ts
index 8a27c659..f34898c0 100644
--- a/src/hooks/types.ts
+++ b/src/hooks/types.ts
@@ -7,6 +7,7 @@ import { RetryConfig } from "../lib/retries.js";
import { SecurityState } from "../lib/security.js";
export type HookContext = {
+ baseURL: string | URL;
operationID: string;
oAuth2Scopes?: string[];
securitySource?: any | (() => Promise);
diff --git a/src/lib/config.ts b/src/lib/config.ts
index 0a946ec4..6cb4b442 100644
--- a/src/lib/config.ts
+++ b/src/lib/config.ts
@@ -31,29 +31,29 @@ export const ServerProtocol = {
export type ServerProtocol = ClosedEnum;
export type SDKOptions = {
- accessToken?: string | (() => Promise);
+ accessToken?: string | (() => Promise) | undefined;
httpClient?: HTTPClient;
/**
* Allows overriding the default server used by the SDK
*/
- serverIdx?: number;
+ serverIdx?: number | undefined;
/**
* Sets the protocol variable for url substitution
*/
- protocol?: ServerProtocol;
+ protocol?: ServerProtocol | undefined;
/**
* Sets the ip variable for url substitution
*/
- ip?: string;
+ ip?: string | undefined;
/**
* Sets the port variable for url substitution
*/
- port?: string;
+ port?: string | undefined;
/**
* Allows overriding the default server URL used by the SDK
*/
- serverURL?: string;
+ serverURL?: string | undefined;
/**
* Allows overriding the default retry config used by the SDK
*/
@@ -90,7 +90,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "0.0.3",
- sdkVersion: "0.34.0",
- genVersion: "2.506.0",
- userAgent: "speakeasy-sdk/typescript 0.34.0 2.506.0 0.0.3 @lukehagar/plexjs",
+ sdkVersion: "0.35.0",
+ genVersion: "2.545.2",
+ userAgent: "speakeasy-sdk/typescript 0.35.0 2.545.2 0.0.3 @lukehagar/plexjs",
} as const;
diff --git a/src/lib/files.ts b/src/lib/files.ts
index 19e08041..59d15f09 100644
--- a/src/lib/files.ts
+++ b/src/lib/files.ts
@@ -36,5 +36,5 @@ export async function readableStreamToArrayBuffer(
offset += chunk.length;
}
- return concatenatedChunks.buffer;
+ return concatenatedChunks.buffer as ArrayBuffer;
}
diff --git a/src/lib/primitives.ts b/src/lib/primitives.ts
index ce50b98a..d21f1dc4 100644
--- a/src/lib/primitives.ts
+++ b/src/lib/primitives.ts
@@ -134,3 +134,17 @@ export function compactMap(
return out;
}
+
+export function allRequired>(
+ v: V,
+):
+ | {
+ [K in keyof V]: NonNullable;
+ }
+ | undefined {
+ if (Object.values(v).every((x) => x == null)) {
+ return void 0;
+ }
+
+ return v as ReturnType>;
+}
diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts
index 8bfac635..875baf82 100644
--- a/src/lib/sdks.ts
+++ b/src/lib/sdks.ts
@@ -78,7 +78,7 @@ export class ClientSDK {
readonly #httpClient: HTTPClient;
readonly #hooks: SDKHooks;
readonly #logger?: Logger | undefined;
- protected readonly _baseURL: URL | null;
+ public readonly _baseURL: URL | null;
public readonly _options: SDKOptions & { hooks?: SDKHooks };
constructor(options: SDKOptions = {}) {
diff --git a/src/lib/security.ts b/src/lib/security.ts
index d1b11b74..7cc99e0c 100644
--- a/src/lib/security.ts
+++ b/src/lib/security.ts
@@ -3,7 +3,6 @@
*/
import * as shared from "../sdk/models/shared/index.js";
-
type OAuth2PasswordFlow = {
username: string;
password?: string | undefined;
diff --git a/src/sdk/models/operations/gettokendetails.ts b/src/sdk/models/operations/gettokendetails.ts
index 77383672..e1c5f60a 100644
--- a/src/sdk/models/operations/gettokendetails.ts
+++ b/src/sdk/models/operations/gettokendetails.ts
@@ -296,7 +296,7 @@ export type GetTokenDetailsUserPlexAccount = {
* Description of the Plex Pass subscription
*/
subscriptionDescription: string | null;
- subscriptions: Array;
+ subscriptions?: Array | undefined;
/**
* URL of the account thumbnail
*/
@@ -852,7 +852,7 @@ export const GetTokenDetailsUserPlexAccount$inboundSchema: z.ZodType<
subscriptionDescription: z.nullable(z.string()),
subscriptions: z.array(
z.lazy(() => GetTokenDetailsSubscription$inboundSchema),
- ),
+ ).optional(),
thumb: z.string(),
title: z.string(),
twoFactorEnabled: z.boolean().default(false),
@@ -897,7 +897,7 @@ export type GetTokenDetailsUserPlexAccount$Outbound = {
services: Array;
subscription: Subscription$Outbound;
subscriptionDescription: string | null;
- subscriptions: Array;
+ subscriptions?: Array | undefined;
thumb: string;
title: string;
twoFactorEnabled: boolean;
@@ -948,7 +948,7 @@ export const GetTokenDetailsUserPlexAccount$outboundSchema: z.ZodType<
subscriptionDescription: z.nullable(z.string()),
subscriptions: z.array(
z.lazy(() => GetTokenDetailsSubscription$outboundSchema),
- ),
+ ).optional(),
thumb: z.string(),
title: z.string(),
twoFactorEnabled: z.boolean().default(false),
diff --git a/src/sdk/models/operations/postuserssignindata.ts b/src/sdk/models/operations/postuserssignindata.ts
index a5c066ae..8af99dae 100644
--- a/src/sdk/models/operations/postuserssignindata.ts
+++ b/src/sdk/models/operations/postuserssignindata.ts
@@ -368,7 +368,9 @@ export type PostUsersSignInDataUserPlexAccount = {
* Description of the Plex Pass subscription
*/
subscriptionDescription: string | null;
- subscriptions: Array;
+ subscriptions?:
+ | Array
+ | undefined;
/**
* URL of the account thumbnail
*/
@@ -1384,7 +1386,7 @@ export const PostUsersSignInDataUserPlexAccount$inboundSchema: z.ZodType<
subscriptionDescription: z.nullable(z.string()),
subscriptions: z.array(
z.lazy(() => PostUsersSignInDataAuthenticationSubscription$inboundSchema),
- ),
+ ).optional(),
thumb: z.string(),
title: z.string(),
twoFactorEnabled: z.boolean().default(false),
@@ -1431,7 +1433,9 @@ export type PostUsersSignInDataUserPlexAccount$Outbound = {
services: Array;
subscription: PostUsersSignInDataSubscription$Outbound;
subscriptionDescription: string | null;
- subscriptions: Array;
+ subscriptions?:
+ | Array
+ | undefined;
thumb: string;
title: string;
twoFactorEnabled: boolean;
@@ -1484,7 +1488,7 @@ export const PostUsersSignInDataUserPlexAccount$outboundSchema: z.ZodType<
subscriptionDescription: z.nullable(z.string()),
subscriptions: z.array(
z.lazy(() => PostUsersSignInDataAuthenticationSubscription$outboundSchema),
- ),
+ ).optional(),
thumb: z.string(),
title: z.string(),
twoFactorEnabled: z.boolean().default(false),
diff --git a/src/sdk/types/async.ts b/src/sdk/types/async.ts
new file mode 100644
index 00000000..689dba5d
--- /dev/null
+++ b/src/sdk/types/async.ts
@@ -0,0 +1,68 @@
+/*
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
+ */
+
+export type APICall =
+ | {
+ status: "complete";
+ request: Request;
+ response: Response;
+ }
+ | {
+ status: "request-error";
+ request: Request;
+ response?: undefined;
+ }
+ | {
+ status: "invalid";
+ request?: undefined;
+ response?: undefined;
+ };
+
+export class APIPromise implements Promise {
+ readonly #promise: Promise<[T, APICall]>;
+ readonly #unwrapped: Promise;
+
+ readonly [Symbol.toStringTag] = "APIPromise";
+
+ constructor(p: [T, APICall] | Promise<[T, APICall]>) {
+ this.#promise = p instanceof Promise ? p : Promise.resolve(p);
+ this.#unwrapped =
+ p instanceof Promise
+ ? this.#promise.then(([value]) => value)
+ : Promise.resolve(p[0]);
+ }
+
+ then(
+ onfulfilled?:
+ | ((value: T) => TResult1 | PromiseLike)
+ | null
+ | undefined,
+ onrejected?:
+ | ((reason: any) => TResult2 | PromiseLike)
+ | null
+ | undefined,
+ ): Promise {
+ return this.#promise.then(
+ onfulfilled ? ([value]) => onfulfilled(value) : void 0,
+ onrejected,
+ );
+ }
+
+ catch(
+ onrejected?:
+ | ((reason: any) => TResult | PromiseLike)
+ | null
+ | undefined,
+ ): Promise {
+ return this.#unwrapped.catch(onrejected);
+ }
+
+ finally(onfinally?: (() => void) | null | undefined): Promise {
+ return this.#unwrapped.finally(onfinally);
+ }
+
+ $inspect(): Promise<[T, APICall]> {
+ return this.#promise;
+ }
+}