diff --git a/docs/content/docs/api/account/account.platforms.mdx b/docs/content/docs/api/account/account.platforms.mdx new file mode 100644 index 0000000..1387153 --- /dev/null +++ b/docs/content/docs/api/account/account.platforms.mdx @@ -0,0 +1,17 @@ +--- +title: Get user's streaming platforms +full: true +_openapi: + method: GET + toc: [] + structuredData: + headings: [] + contents: + - content: Fetch the current user's subscribed streaming platform IDs. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + +Fetch the current user's subscribed streaming platform IDs. + + \ No newline at end of file diff --git a/docs/content/docs/api/account/account.updatePlatforms.mdx b/docs/content/docs/api/account/account.updatePlatforms.mdx new file mode 100644 index 0000000..506f297 --- /dev/null +++ b/docs/content/docs/api/account/account.updatePlatforms.mdx @@ -0,0 +1,17 @@ +--- +title: Update streaming platforms +full: true +_openapi: + method: PUT + toc: [] + structuredData: + headings: [] + contents: + - content: Set the current user's subscribed streaming platforms. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + +Set the current user's subscribed streaming platforms. + + \ No newline at end of file diff --git a/docs/content/docs/api/platforms/platforms.list.mdx b/docs/content/docs/api/platforms/platforms.list.mdx new file mode 100644 index 0000000..901de36 --- /dev/null +++ b/docs/content/docs/api/platforms/platforms.list.mdx @@ -0,0 +1,17 @@ +--- +title: List all platforms +full: true +_openapi: + method: GET + toc: [] + structuredData: + headings: [] + contents: + - content: Fetch all available streaming platforms, ordered by popularity. +--- + +{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} + +Fetch all available streaming platforms, ordered by popularity. + + \ No newline at end of file diff --git a/docs/public/openapi.json b/docs/public/openapi.json index a77d14d..700d30e 100644 --- a/docs/public/openapi.json +++ b/docs/public/openapi.json @@ -1695,11 +1695,11 @@ "allowReserved": true }, { - "name": "availableToStream", + "name": "onMyServices", "in": "query", "schema": { "type": "boolean", - "description": "Only show titles with streaming availability" + "description": "Only show titles available on the user's streaming services" }, "allowEmptyValue": true, "allowReserved": true @@ -2025,9 +2025,9 @@ "items": { "type": "object", "properties": { - "providerId": { - "type": "number", - "description": "JustWatch provider ID" + "platformId": { + "type": "string", + "description": "Platform ID" }, "providerName": { "type": "string", @@ -2058,14 +2058,19 @@ } ], "description": "Direct link to watch on this provider" + }, + "isUserSubscribed": { + "type": "boolean", + "description": "Whether the user subscribes to this platform" } }, "required": [ - "providerId", + "platformId", "providerName", "logoPath", "offerType", - "watchUrl" + "watchUrl", + "isUserSubscribed" ], "description": "A streaming availability offer from a provider" }, @@ -3486,8 +3491,8 @@ { "type": "object", "properties": { - "providerId": { - "type": "number" + "platformId": { + "type": "string" }, "providerName": { "type": "string" @@ -3504,7 +3509,7 @@ } }, "required": [ - "providerId", + "platformId", "providerName", "logoPath" ] @@ -4335,7 +4340,18 @@ "type": "object", "properties": { "id": { - "type": "number", + "type": "string", + "description": "Platform ID" + }, + "tmdbProviderId": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], "description": "TMDB provider ID" }, "name": { @@ -4356,6 +4372,7 @@ }, "required": [ "id", + "tmdbProviderId", "name", "logoPath" ] @@ -4835,6 +4852,9 @@ "required": false, "schema": { "type": "string", + "minLength": 2, + "maxLength": 2, + "pattern": "^[a-z]{2}$", "description": "ISO 639-1 original language code" }, "allowEmptyValue": true, @@ -6646,6 +6666,166 @@ ] } }, + "/account/platforms": { + "get": { + "operationId": "account.platforms", + "summary": "Get user's streaming platforms", + "description": "Fetch the current user's subscribed streaming platform IDs.", + "tags": [ + "Account" + ], + "responses": { + "200": { + "description": "List of platform IDs", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "platformIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "platformIds" + ] + } + } + } + } + }, + "security": [ + { + "session": [] + } + ] + }, + "put": { + "operationId": "account.updatePlatforms", + "summary": "Update streaming platforms", + "description": "Set the current user's subscribed streaming platforms.", + "tags": [ + "Account" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "platformIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of platform IDs the user subscribes to" + } + }, + "required": [ + "platformIds" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + }, + "security": [ + { + "session": [] + } + ] + } + }, + "/platforms": { + "get": { + "operationId": "platforms.list", + "summary": "List all platforms", + "description": "Fetch all available streaming platforms, ordered by popularity.", + "tags": [ + "Platforms" + ], + "responses": { + "200": { + "description": "All platforms with metadata", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "platforms": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Platform ID" + }, + "name": { + "type": "string", + "description": "Display name" + }, + "tmdbProviderId": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "TMDB provider ID (null for custom platforms)" + }, + "logoPath": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Logo image path" + }, + "displayOrder": { + "type": "number", + "description": "Sort order" + } + }, + "required": [ + "id", + "name", + "tmdbProviderId", + "logoPath", + "displayOrder" + ], + "description": "A streaming platform" + } + } + }, + "required": [ + "platforms" + ] + } + } + } + } + }, + "security": [ + { + "session": [] + } + ] + } + }, "/imports/parse-file": { "post": { "operationId": "imports.parseFile",