diff --git a/src/components/maincontroller.ts b/src/components/maincontroller.ts index 5a25232b..485aa9e0 100644 --- a/src/components/maincontroller.ts +++ b/src/components/maincontroller.ts @@ -593,13 +593,12 @@ export async function translateItems( export async function instantMix( // eslint-disable-next-line @typescript-eslint/no-explicit-any data: any, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - options: any, + options: PlayRequest, item: BaseItemDto ): Promise { const result = await getInstantMixItems(data.userId, item); - options.items = result.Items; + options.items = result.Items ?? []; PlaybackManager.playFromOptions(data.options); } @@ -613,13 +612,12 @@ export async function instantMix( export async function shuffle( // eslint-disable-next-line @typescript-eslint/no-explicit-any data: any, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - options: any, + options: PlayRequest, item: BaseItemDto ): Promise { const result = await getShuffleItems(data.userId, item); - options.items = result.Items; + options.items = result.Items ?? []; PlaybackManager.playFromOptions(data.options); } diff --git a/src/components/playbackManager.ts b/src/components/playbackManager.ts index 10d7792b..b0406c9d 100644 --- a/src/components/playbackManager.ts +++ b/src/components/playbackManager.ts @@ -26,7 +26,7 @@ import { checkDirectPlay, createMediaInformation } from './maincontroller'; -import { ItemIndex } from '~/types/global'; +import { ItemIndex, PlayRequest } from '~/types/global'; export interface PlaybackState { startPositionTicks: number; @@ -104,8 +104,7 @@ export abstract class PlaybackManager { ); } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - static async playFromOptions(options: any): Promise { + static async playFromOptions(options: PlayRequest): Promise { const firstItem = options.items[0]; if (options.startPositionTicks || firstItem.MediaType !== 'Video') {