diff --git a/src/components/__tests__/jellyfinApi.test.ts b/src/components/__tests__/jellyfinApi.test.ts index fe959dd1..616b0925 100644 --- a/src/components/__tests__/jellyfinApi.test.ts +++ b/src/components/__tests__/jellyfinApi.test.ts @@ -1,8 +1,8 @@ import { JellyfinApi } from '../jellyfinApi'; const setupMockCastSenders = (): void => { - const getSenders = (): Array => [{ id: 'thisIsSenderId' }]; // eslint-disable-line no-explicit-any - const getInstance = (): any => ({ getSenders }); // eslint-disable-line no-explicit-any + const getSenders = (): Array => [{ id: 'thisIsSenderId' }]; // eslint-disable-line @typescript-eslint/no-explicit-any + const getInstance = (): any => ({ getSenders }); // eslint-disable-line @typescript-eslint/no-explicit-any // @ts-expect-error cast is already defined globally, however since we're mocking it we need to redefine it. global.cast = { diff --git a/src/components/fetchhelper.ts b/src/components/fetchhelper.ts index 3366c17e..a8ac3ce4 100644 --- a/src/components/fetchhelper.ts +++ b/src/components/fetchhelper.ts @@ -3,7 +3,7 @@ * @param request - Custom request object, mostly modeled after RequestInit. * @returns response promise */ -function getFetchPromise(request: any): Promise { // eslint-disable-line no-explicit-any +function getFetchPromise(request: any): Promise { // eslint-disable-line @typescript-eslint/no-explicit-any const headers = request.headers || {}; if (request.dataType === 'json') { @@ -102,7 +102,7 @@ function paramsToString(params: Record): string { * @param request - RequestInit-like structure but with url/type/timeout parameters as well * @returns response promise, may be automatically unpacked based on request datatype */ -export async function ajax(request: any): Promise { // eslint-disable-line no-explicit-any +export async function ajax(request: any): Promise { // eslint-disable-line @typescript-eslint/no-explicit-any if (!request) { throw new Error('Request cannot be null'); } diff --git a/src/components/jellyfinActions.ts b/src/components/jellyfinActions.ts index 159ec9c6..0a276aae 100644 --- a/src/components/jellyfinActions.ts +++ b/src/components/jellyfinActions.ts @@ -34,7 +34,7 @@ function restartPingInterval(reportingParams: PlaybackProgressInfo): void { stopPingInterval(); if (reportingParams.PlayMethod == 'Transcode') { - pingInterval = setInterval(() => { // eslint-disable-line no-explicit-any + pingInterval = setInterval(() => { // eslint-disable-line @typescript-eslint/no-explicit-any pingTranscoder(reportingParams); }, 1000); } @@ -183,7 +183,7 @@ export function pingTranscoder( * @param customData - data to set on playback state. * @param serverItem - item that is playing */ -export function load(customData: any, serverItem: BaseItemDto): void { // eslint-disable-line no-explicit-any +export function load(customData: any, serverItem: BaseItemDto): void { // eslint-disable-line @typescript-eslint/no-explicit-any PlaybackManager.resetPlaybackScope(); const state = PlaybackManager.playbackState; @@ -255,7 +255,7 @@ export function getPlaybackInfo( audioStreamIndex: number, subtitleStreamIndex: number, liveStreamId: string | null = null -): Promise { // eslint-disable-line no-explicit-any +): Promise { // eslint-disable-line @typescript-eslint/no-explicit-any const postData = { DeviceProfile: deviceProfile }; diff --git a/src/components/jellyfinApi.ts b/src/components/jellyfinApi.ts index 871645a9..38f4afd3 100644 --- a/src/components/jellyfinApi.ts +++ b/src/components/jellyfinApi.ts @@ -124,7 +124,7 @@ export abstract class JellyfinApi { } // Authenticated ajax - public static authAjax(path: string, args: any): Promise { // eslint-disable-line no-explicit-any + public static authAjax(path: string, args: any): Promise { // eslint-disable-line @typescript-eslint/no-explicit-any if ( this.userId === undefined || this.accessToken === undefined || @@ -146,7 +146,7 @@ export abstract class JellyfinApi { } // Authenticated ajax - public static authAjaxUser(path: string, args: any): Promise { // eslint-disable-line no-explicit-any + public static authAjaxUser(path: string, args: any): Promise { // eslint-disable-line @typescript-eslint/no-explicit-any if ( this.userId === undefined || this.accessToken === undefined || diff --git a/src/components/maincontroller.ts b/src/components/maincontroller.ts index 8657b3ff..df187c0a 100644 --- a/src/components/maincontroller.ts +++ b/src/components/maincontroller.ts @@ -284,7 +284,7 @@ export async function reportDeviceCapabilities(): Promise { * processMessage * @param data - data */ -export function processMessage(data: any): void { // eslint-disable-line no-explicit-any +export function processMessage(data: any): void { // eslint-disable-line @typescript-eslint/no-explicit-any if ( !data.command || !data.serverAddress || @@ -385,7 +385,7 @@ export function setSubtitleStreamIndex( // FIXME: Possible index error when MediaStreams is undefined. const currentSubtitleStream = state.mediaSource?.MediaStreams?.filter( - (m: any) => { // eslint-disable-line no-explicit-any + (m: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any return m.Index == state.subtitleStreamIndex && m.Type == 'Subtitle'; } )[0]; @@ -413,7 +413,7 @@ export function setSubtitleStreamIndex( const mediaStreams = state.PlaybackMediaSource?.MediaStreams; const subtitleStream = getStreamByIndex( - mediaStreams, // eslint-disable-line no-explicit-any + mediaStreams, // eslint-disable-line @typescript-eslint/no-explicit-any 'Subtitle', index ); @@ -488,7 +488,7 @@ export function seek(state: PlaybackState, ticks: number): Promise { export async function changeStream( state: PlaybackState, ticks: number, - params: any = undefined // eslint-disable-line no-explicit-any + params: any = undefined // eslint-disable-line @typescript-eslint/no-explicit-any ): Promise { if ( window.playerManager.getMediaInformation()?.customData.canClientSeek && @@ -534,8 +534,8 @@ export async function changeStream( // TODO save namespace somewhere global? window.castReceiverContext.addCustomMessageListener( 'urn:x-cast:com.connectsdk', - (evt: any) => { // eslint-disable-line no-explicit-any - let data: any = evt.data; // eslint-disable-line no-explicit-any + (evt: any) => { // eslint-disable-line @typescript-eslint/no-explicit-any + let data: any = evt.data; // eslint-disable-line @typescript-eslint/no-explicit-any // Apparently chromium likes to pass it as json, not as object. // chrome on android works fine @@ -562,7 +562,7 @@ window.castReceiverContext.addCustomMessageListener( * @returns promise */ export async function translateItems( - data: any, // eslint-disable-line no-explicit-any + data: any, // eslint-disable-line @typescript-eslint/no-explicit-any options: PlayRequest, method: string ): Promise { @@ -595,8 +595,8 @@ export async function translateItems( * @returns promise */ export async function instantMix( - data: any, // eslint-disable-line no-explicit-any - options: any, // eslint-disable-line no-explicit-any + data: any, // eslint-disable-line @typescript-eslint/no-explicit-any + options: any, // eslint-disable-line @typescript-eslint/no-explicit-any item: BaseItemDto ): Promise { const result = await getInstantMixItems(data.userId, item); @@ -613,8 +613,8 @@ export async function instantMix( * @returns promise */ export async function shuffle( - data: any, // eslint-disable-line no-explicit-any - options: any, // eslint-disable-line no-explicit-any + data: any, // eslint-disable-line @typescript-eslint/no-explicit-any + options: any, // eslint-disable-line @typescript-eslint/no-explicit-any item: BaseItemDto ): Promise { const result = await getShuffleItems(data.userId, item); @@ -633,7 +633,7 @@ export async function shuffle( */ export async function onStopPlayerBeforePlaybackDone( item: BaseItemDto, - options: any // eslint-disable-line no-explicit-any + options: any // eslint-disable-line @typescript-eslint/no-explicit-any ): Promise { const data = await JellyfinApi.authAjaxUser(`Items/${item.Id}`, { dataType: 'json', @@ -697,7 +697,7 @@ export function showPlaybackInfoErrorMessage(error: string): void { * @param versions - versions * @returns stream */ -export function getOptimalMediaSource(versions: Array): any { // eslint-disable-line no-explicit-any +export function getOptimalMediaSource(versions: Array): any { // eslint-disable-line @typescript-eslint/no-explicit-any let optimalVersion = versions.filter((v) => { checkDirectPlay(v); @@ -830,7 +830,7 @@ export function setTextTrack(index: number | null): void { export function createMediaInformation( playSessionId: string, item: BaseItemDto, - streamInfo: any // eslint-disable-line no-explicit-any + streamInfo: any // eslint-disable-line @typescript-eslint/no-explicit-any ): framework.messages.MediaInformation { const mediaInfo = new cast.framework.messages.MediaInformation(); diff --git a/src/components/playbackManager.ts b/src/components/playbackManager.ts index 8f405ad3..d3c38381 100644 --- a/src/components/playbackManager.ts +++ b/src/components/playbackManager.ts @@ -99,7 +99,7 @@ export abstract class PlaybackManager { return this.playerManager.getPlayerState() === cast.framework.messages.PlayerState.BUFFERING; } - static async playFromOptions(options: any): Promise { // eslint-disable-line no-explicit-any + static async playFromOptions(options: any): Promise { // eslint-disable-line @typescript-eslint/no-explicit-any const firstItem = options.items[0]; if (options.startPositionTicks || firstItem.MediaType !== 'Video') { @@ -109,7 +109,7 @@ export abstract class PlaybackManager { return this.playFromOptionsInternal(options); } - private static playFromOptionsInternal(options: any): Promise { // eslint-disable-line no-explicit-any + private static playFromOptionsInternal(options: any): Promise { // eslint-disable-line @typescript-eslint/no-explicit-any const stopPlayer = this.activePlaylist && this.activePlaylist.length > 0; @@ -143,7 +143,7 @@ export abstract class PlaybackManager { return this.activePlaylistIndex > 0; } - static playNextItem(options: any = {}, stopPlayer = false): boolean { // eslint-disable-line no-explicit-any + static playNextItem(options: any = {}, stopPlayer = false): boolean { // eslint-disable-line @typescript-eslint/no-explicit-any const nextItemInfo = this.getNextPlaybackItemInfo(); if (nextItemInfo) { @@ -155,7 +155,7 @@ export abstract class PlaybackManager { return false; } - static playPreviousItem(options: any = {}): boolean { // eslint-disable-line no-explicit-any + static playPreviousItem(options: any = {}): boolean { // eslint-disable-line @typescript-eslint/no-explicit-any if (this.activePlaylist && this.activePlaylistIndex > 0) { this.activePlaylistIndex--; this.playItem(options, true); @@ -167,7 +167,7 @@ export abstract class PlaybackManager { // play item from playlist private static async playItem( - options: any, // eslint-disable-line no-explicit-any + options: any, // eslint-disable-line @typescript-eslint/no-explicit-any stopPlayer = false ): Promise { if (stopPlayer) { @@ -182,7 +182,7 @@ export abstract class PlaybackManager { // Would set private, but some refactorings need to happen first. static async playItemInternal( item: BaseItemDto, - options: any // eslint-disable-line no-explicit-any + options: any // eslint-disable-line @typescript-eslint/no-explicit-any ): Promise { this.playbackState.isChangingStream = false; DocumentManager.setAppStatus(AppStatus.Loading); @@ -247,7 +247,7 @@ export abstract class PlaybackManager { playSessionId: string, item: BaseItemDto, mediaSource: MediaSourceInfo, - options: any // eslint-disable-line no-explicit-any + options: any // eslint-disable-line @typescript-eslint/no-explicit-any ): void { DocumentManager.setAppStatus(AppStatus.Loading);