mirror of
https://github.com/jellyfin/jellyfin-chromecast.git
synced 2024-11-27 00:00:28 +00:00
Merge pull request #665 from 3flex/playrequest-typing
Add PlayRequest typing
This commit is contained in:
commit
aa84761cf9
@ -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<void> {
|
||||
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<void> {
|
||||
const result = await getShuffleItems(data.userId, item);
|
||||
|
||||
options.items = result.Items;
|
||||
options.items = result.Items ?? [];
|
||||
PlaybackManager.playFromOptions(data.options);
|
||||
}
|
||||
|
||||
|
@ -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<void> {
|
||||
static async playFromOptions(options: PlayRequest): Promise<void> {
|
||||
const firstItem = options.items[0];
|
||||
|
||||
if (options.startPositionTicks || firstItem.MediaType !== 'Video') {
|
||||
|
Loading…
Reference in New Issue
Block a user