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(
|
export async function instantMix(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
data: any,
|
data: any,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
options: PlayRequest,
|
||||||
options: any,
|
|
||||||
item: BaseItemDto
|
item: BaseItemDto
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const result = await getInstantMixItems(data.userId, item);
|
const result = await getInstantMixItems(data.userId, item);
|
||||||
|
|
||||||
options.items = result.Items;
|
options.items = result.Items ?? [];
|
||||||
PlaybackManager.playFromOptions(data.options);
|
PlaybackManager.playFromOptions(data.options);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -613,13 +612,12 @@ export async function instantMix(
|
|||||||
export async function shuffle(
|
export async function shuffle(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
data: any,
|
data: any,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
options: PlayRequest,
|
||||||
options: any,
|
|
||||||
item: BaseItemDto
|
item: BaseItemDto
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const result = await getShuffleItems(data.userId, item);
|
const result = await getShuffleItems(data.userId, item);
|
||||||
|
|
||||||
options.items = result.Items;
|
options.items = result.Items ?? [];
|
||||||
PlaybackManager.playFromOptions(data.options);
|
PlaybackManager.playFromOptions(data.options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import {
|
|||||||
checkDirectPlay,
|
checkDirectPlay,
|
||||||
createMediaInformation
|
createMediaInformation
|
||||||
} from './maincontroller';
|
} from './maincontroller';
|
||||||
import { ItemIndex } from '~/types/global';
|
import { ItemIndex, PlayRequest } from '~/types/global';
|
||||||
|
|
||||||
export interface PlaybackState {
|
export interface PlaybackState {
|
||||||
startPositionTicks: number;
|
startPositionTicks: number;
|
||||||
@ -104,8 +104,7 @@ export abstract class PlaybackManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
static async playFromOptions(options: PlayRequest): Promise<void> {
|
||||||
static async playFromOptions(options: any): Promise<void> {
|
|
||||||
const firstItem = options.items[0];
|
const firstItem = options.items[0];
|
||||||
|
|
||||||
if (options.startPositionTicks || firstItem.MediaType !== 'Video') {
|
if (options.startPositionTicks || firstItem.MediaType !== 'Video') {
|
||||||
|
Loading…
Reference in New Issue
Block a user