From 43ed14bfd0035798c569f7bae2fa2961b1a85171 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:49:37 +1100 Subject: [PATCH] Migrate reportDeviceCapabilities to jellyfin-sdk-typescript --- src/components/maincontroller.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/components/maincontroller.ts b/src/components/maincontroller.ts index 899a6cfa..bfb58465 100644 --- a/src/components/maincontroller.ts +++ b/src/components/maincontroller.ts @@ -3,6 +3,7 @@ import type { MediaStream, MediaSourceInfo } from '@jellyfin/sdk/lib/generated-client'; +import { getSessionApi } from '@jellyfin/sdk/lib/utils/api'; import { getCurrentPositionTicks, getReportingParams, @@ -268,19 +269,15 @@ export async function reportDeviceCapabilities(): Promise { enableHls: true }); - const capabilities = { - DeviceProfile: deviceProfile, - PlayableMediaTypes: ['Audio', 'Video'], - SupportsMediaControl: true, - SupportsPersistentIdentifier: false - }; - hasReportedCapabilities = true; - return JellyfinApi.authAjax('Sessions/Capabilities/Full', { - contentType: 'application/json', - data: JSON.stringify(capabilities), - type: 'POST' + await getSessionApi(JellyfinApi.jellyfinApi).postFullCapabilities({ + clientCapabilitiesDto: { + DeviceProfile: deviceProfile, + PlayableMediaTypes: ['Audio', 'Video'], + SupportsMediaControl: true, + SupportsPersistentIdentifier: false + } }); }