diff --git a/.eslintrc.js b/.eslintrc.js index c70176a6..1c691223 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -35,6 +35,7 @@ module.exports = { root: true, rules: { '@typescript-eslint/explicit-function-return-type': 'error', + '@typescript-eslint/no-explicit-any': 'warn', '@typescript-eslint/no-unused-vars': 'error', '@typescript-eslint/prefer-ts-expect-error': 'error', curly: 'error', diff --git a/src/components/castDevices.ts b/src/components/castDevices.ts index 6c873847..9ef0556e 100644 --- a/src/components/castDevices.ts +++ b/src/components/castDevices.ts @@ -16,7 +16,6 @@ let deviceId: number | null = null; /** * Get device id of the active Cast device. * Tries to identify the active Cast device by testing support for different codecs. - * * @returns Active Cast device Id. */ export function getActiveDeviceId(): number { diff --git a/src/components/codecSupportHelper.ts b/src/components/codecSupportHelper.ts index fa8d9649..214732ed 100644 --- a/src/components/codecSupportHelper.ts +++ b/src/components/codecSupportHelper.ts @@ -9,7 +9,6 @@ const castContext = cast.framework.CastReceiverContext.getInstance(); * depends on the manual setting. * * Currently it's disabled because of problems getting it to work with HLS. - * * @returns true if E-AC-3 can be played */ export function hasEAC3Support(): boolean { @@ -24,9 +23,7 @@ export function hasEAC3Support(): boolean { * depends on the manual setting. * * Currently it's disabled because of problems getting it to work with HLS. - * * @returns true if AC-3 can be played - * */ export function hasAC3Support(): boolean { //return castContext.canDisplayType('audio/mp4', 'ac-3'); @@ -40,7 +37,6 @@ export function hasAC3Support(): boolean { * will mostly support 6ch pcm, and if any generation of cast devices * is actually capable of decoding e.g. aac 6ch, we can return true here * and give it a shot. - * * @returns true if surround codecs can be played */ export function hasSurroundSupport(): boolean { @@ -50,7 +46,6 @@ export function hasSurroundSupport(): boolean { /** * Check if this device can play HEVC content. - * * @returns true if HEVC is supported */ export function hasH265Support(): boolean { @@ -61,7 +56,6 @@ export function hasH265Support(): boolean { * Check if this device can play text tracks. * This is not supported on Chromecast Audio, * but otherwise is. - * * @param deviceId - the device id * @returns true if text tracks are supported */ @@ -71,7 +65,6 @@ export function hasTextTrackSupport(deviceId: number): boolean { /** * Check if this device can play VP-8 content. - * * @returns true if VP-8 is supported */ export function hasVP8Support(): boolean { @@ -80,7 +73,6 @@ export function hasVP8Support(): boolean { /** * Check if this device can play VP-9 content. - * * @returns true if VP-9 is supported */ export function hasVP9Support(): boolean { @@ -89,7 +81,6 @@ export function hasVP9Support(): boolean { /** * Get the max supported media bitrate for the active Cast device. - * * @returns Max supported bitrate. */ export function getMaxBitrateSupport(): number { @@ -101,7 +92,6 @@ export function getMaxBitrateSupport(): number { /** * Get the max supported video width the active Cast device supports. - * * @param deviceId - Cast device id. * @returns Max supported width. */ @@ -122,7 +112,6 @@ export function getMaxWidthSupport(deviceId: number): number { /** * Get all H.264 profiles supported by the active Cast device. - * * @param deviceId - Cast device id. * @returns All supported H.264 profiles. */ @@ -139,7 +128,6 @@ export function getH264ProfileSupport(deviceId: number): string { /** * Get the highest H.264 level supported by the active Cast device. - * * @param deviceId - Cast device id. * @returns The highest supported H.264 level. */ @@ -160,7 +148,6 @@ export function getH264LevelSupport(deviceId: number): number { /** * Get all H.265 profiles supported by the active Cast device. - * * @param deviceId - Cast device id. * @returns All supported H.265 profiles. */ @@ -175,7 +162,6 @@ export function getH265ProfileSupport(deviceId: number): string { /** * Get the highest H.265 level supported by the active Cast device. - * * @param deviceId - Cast device id. * @returns The highest supported H.265 level. */ @@ -189,7 +175,6 @@ export function getH265LevelSupport(deviceId: number): number { /** * Get VPX (VP8, VP9) codecs supported by the active Cast device. - * * @returns Supported VPX codecs. */ export function getSupportedVPXVideoCodecs(): Array { @@ -208,7 +193,6 @@ export function getSupportedVPXVideoCodecs(): Array { /** * Get supported video codecs suitable for use in an MP4 container. - * * @returns Supported MP4 video codecs. */ export function getSupportedMP4VideoCodecs(): Array { @@ -224,7 +208,6 @@ export function getSupportedMP4VideoCodecs(): Array { /** * Get supported audio codecs suitable for use in an MP4 container. - * * @returns Supported MP4 audio codecs. */ export function getSupportedMP4AudioCodecs(): Array { @@ -246,7 +229,6 @@ export function getSupportedMP4AudioCodecs(): Array { /** * Get supported video codecs suitable for use with HLS. - * * @returns Supported HLS video codecs. */ export function getSupportedHLSVideoCodecs(): Array { @@ -257,7 +239,6 @@ export function getSupportedHLSVideoCodecs(): Array { /** * Get supported audio codecs suitable for use with HLS. - * * @returns All supported HLS audio codecs. */ export function getSupportedHLSAudioCodecs(): Array { @@ -267,7 +248,6 @@ export function getSupportedHLSAudioCodecs(): Array { /** * Get supported audio codecs suitable for use in a WebM container. - * * @returns All supported WebM audio codecs. */ export function getSupportedWebMAudioCodecs(): Array { @@ -276,7 +256,6 @@ export function getSupportedWebMAudioCodecs(): Array { /** * Get supported audio codecs suitable for use in a WebM container. - * * @returns All supported WebM audio codecs. */ export function getSupportedAudioCodecs(): Array { diff --git a/src/components/credentialManager.ts b/src/components/credentialManager.ts index 90dce8ac..4306798c 100644 --- a/src/components/credentialManager.ts +++ b/src/components/credentialManager.ts @@ -11,14 +11,12 @@ interface CredentialStore { export class credentialManager { /** * Store for credentials - * * @private */ private credentialStore: CredentialStore; /** * Default constructor for credentialManager. - * * @param initialStore - Existing CredentialStore to initialize private store with. */ constructor(initialStore: CredentialStore = {}) { @@ -27,7 +25,6 @@ export class credentialManager { /** * Get credentials for the provided server ID. - * * @param serverId - ID of the server the credentials belong to. * @returns Credentials for the provided server ID. * or undefined if the store has no server with that ID. @@ -40,7 +37,6 @@ export class credentialManager { /** * Update credentials for the provided server ID. - * * @param serverId - ID of the server to update. * @param newCredentials - Updated Credentials. * @returns True if the value was updated, false if it wasn't. @@ -57,7 +53,6 @@ export class credentialManager { /** * Add a new credential to store. Only accepts new entries. - * * @param serverId - ID of the server the credentials belong to. * @param credentials - Credentials of the server. * @returns True if server was added, false if it wasn't. @@ -74,7 +69,6 @@ export class credentialManager { /** * Remove a credential from store. - * * @param serverId - ID of the server the credentials belong to. * @returns True if server was removed, false if it wasn't. */ diff --git a/src/components/deviceprofileBuilder.ts b/src/components/deviceprofileBuilder.ts index a9af44bb..2c801e9e 100644 --- a/src/components/deviceprofileBuilder.ts +++ b/src/components/deviceprofileBuilder.ts @@ -48,7 +48,7 @@ let currentDeviceId: number; * @param Property - What property the condition should test. * @param Condition - The condition to test the values for. * @param Value - The value to compare against. - * @param [IsRequired=false] - Don't permit unknown values + * @param [IsRequired] - Don't permit unknown values * @returns A profile condition created from the parameters. */ function createProfileCondition( @@ -397,7 +397,6 @@ function getSubtitleProfiles(): Array { /** * Creates a device profile containing supported codecs for the active Cast device. - * * @param options - Profile options * @returns Device profile. */ diff --git a/src/components/documentManager.ts b/src/components/documentManager.ts index 1a1dfe1f..839694e2 100644 --- a/src/components/documentManager.ts +++ b/src/components/documentManager.ts @@ -25,7 +25,6 @@ export abstract class DocumentManager { /** * Set the background image for a html element, without preload. * You should do the preloading first with preloadImage. - * * @param element - HTML Element * @param src - URL to the image or null to remove the active one */ @@ -42,7 +41,6 @@ export abstract class DocumentManager { /** * Preload an image - * * @param src - URL to the image or null * @returns wait for the preload and return the url to use. Might be nulled after loading error. */ @@ -67,7 +65,6 @@ export abstract class DocumentManager { /** * Get url for primary image for a given item - * * @param item - to look up * @returns url to image after preload */ @@ -104,7 +101,6 @@ export abstract class DocumentManager { /** * Get url for logo image for a given item - * * @param item - to look up * @returns url to logo image after preload */ @@ -132,7 +128,6 @@ export abstract class DocumentManager { * This fucntion takes an item and shows details about it * on the details page. This happens when no media is playing, * and the connected client is browsing the library. - * * @param item - to show information about * @returns for the page to load */ @@ -192,7 +187,6 @@ export abstract class DocumentManager { /** * Set value of played indicator - * * @param value - True = played, false = not visible, number = number of unplayed items */ private static setPlayedIndicator(value: boolean | number): void { @@ -220,7 +214,6 @@ export abstract class DocumentManager { /** * Show item, but from just the id number, not an actual item. * Looks up the item and then calls showItem - * * @param itemId - id of item to look up * @returns promise that resolves when the item is shown */ @@ -243,7 +236,6 @@ export abstract class DocumentManager { /** * Update item rating elements - * * @param item - to look up */ private static setRating(item: BaseItemDto): void { @@ -283,7 +275,6 @@ export abstract class DocumentManager { /** * Set the status of the app, and switch the visible view * to the corresponding one. - * * @param status - to set */ public static setAppStatus(status: string): void { @@ -293,7 +284,6 @@ export abstract class DocumentManager { /** * Get the status of the app - * * @returns app status */ public static getAppStatus(): string { @@ -304,7 +294,6 @@ export abstract class DocumentManager { /** * Get url to the backdrop image, and return a preload promise. - * * @param item - Item to use for waiting backdrop, null to remove it. * @returns promise for the preload to complete */ @@ -347,7 +336,6 @@ export abstract class DocumentManager { * Backdrops are set on the waiting container. * They are switched around every 30 seconds by default * (governed by startBackdropInterval) - * * @param src - Url to image * @param item - Item to use for waiting backdrop, null to remove it. */ @@ -367,7 +355,6 @@ export abstract class DocumentManager { /** * Set a random backdrop on the waiting container - * * @returns promise waiting for the backdrop to be set */ private static async setRandomUserBackdrop(): Promise { @@ -411,7 +398,6 @@ export abstract class DocumentManager { /** * Start the backdrop rotation, restart if running, stop if disabled - * * @returns promise for the first backdrop to be set */ public static async startBackdropInterval(): Promise { @@ -442,7 +428,6 @@ export abstract class DocumentManager { /** * Set interval between backdrop changes, null to disable - * * @param period - in milliseconds or null */ public static setBackdropPeriodMs(period: number | null): void { @@ -466,7 +451,6 @@ export abstract class DocumentManager { /** * Set background behind the media player, * this is shown while the media is loading. - * * @param item - to get backdrop from */ public static setPlayerBackdrop(item: BaseItemDto): void { @@ -512,7 +496,6 @@ export abstract class DocumentManager { /** * Set the URL to the item logo, or null to remove it - * * @param src - Source url or null */ public static setLogo(src: string | null): void { @@ -524,7 +507,6 @@ export abstract class DocumentManager { /** * Set the URL to the item banner image (I think?), * or null to remove it - * * @param src - Source url or null */ public static setDetailImage(src: string | null): void { @@ -538,7 +520,6 @@ export abstract class DocumentManager { * * This combines the old statement setDisplayName(getDisplayName(item)) * into setDisplayName(item). - * * @param item - source for the displayed name */ private static setDisplayName(item: BaseItemDto): void { @@ -571,7 +552,6 @@ export abstract class DocumentManager { /** * Set the html of the genres container - * * @param name - String/html for genres box, null to empty */ private static setGenres(name: string | null): void { @@ -582,7 +562,6 @@ export abstract class DocumentManager { /** * Set the html of the overview container - * * @param name - string or html to insert */ private static setOverview(name: string | null): void { @@ -594,7 +573,6 @@ export abstract class DocumentManager { /** * Set the progress of the progress bar in the * item details page. (Not the same as the playback ui) - * * @param value - Percentage to set */ private static setPlayedPercentage(value = 0): void { @@ -608,7 +586,6 @@ export abstract class DocumentManager { /** * Set the visibility of the item progress bar in the * item details page - * * @param value - If true, show progress on details page */ private static setHasPlayedPercentage(value: boolean): void { @@ -624,7 +601,6 @@ export abstract class DocumentManager { /** * Get a human readable representation of the current position * in ticks - * * @param ticks - tick position * @returns human readable position */ @@ -667,7 +643,6 @@ export abstract class DocumentManager { /** * Set information about mostly episodes or series * on the item details page - * * @param item - to look up */ private static setMiscInfo(item: BaseItemDto): void { @@ -769,7 +744,6 @@ export abstract class DocumentManager { // Generic / Helper functions /** * Set the visibility of an element - * * @param element - Element to set visibility on * @param visible - True if the element should be visible. */ @@ -783,7 +757,6 @@ export abstract class DocumentManager { /** * Get a HTMLElement from id or throw an error - * * @param id - ID to look up * @returns HTML Element */ @@ -799,7 +772,6 @@ export abstract class DocumentManager { /** * Get a HTMLElement by class - * * @param cls - Class to look up * @returns HTML Element */ diff --git a/src/components/fetchhelper.ts b/src/components/fetchhelper.ts index 0fe22826..582fb372 100644 --- a/src/components/fetchhelper.ts +++ b/src/components/fetchhelper.ts @@ -1,6 +1,5 @@ /** * Function to send a request, with or without the timeout option - * * @param request - Custom request object, mostly modeled after RequestInit. * @returns response promise */ @@ -48,7 +47,6 @@ function getFetchPromise(request: any): Promise { /** * Timeout wrapper for fetch() - * * @param url - url to get * @param options - RequestInit with additional options * @returns response promise @@ -79,7 +77,6 @@ async function fetchWithCredentials( /** * Urlencode a dictionary of strings for use in POST form or GET requests - * * @param params - Dictionary to encode * @returns string with encoded values */ @@ -102,7 +99,6 @@ function paramsToString(params: Record): string { /** * Make an ajax request - * * @param request - RequestInit-like structure but with url/type/timeout parameters as well * @returns response promise, may be automatically unpacked based on request datatype */ diff --git a/src/components/jellyfinActions.ts b/src/components/jellyfinActions.ts index 41828eb3..ecd384e4 100644 --- a/src/components/jellyfinActions.ts +++ b/src/components/jellyfinActions.ts @@ -28,7 +28,6 @@ let lastTranscoderPing = 0; * Start the transcoder pinging. * * This is used to keep the transcode available during pauses - * * @param reportingParams - parameters to report to the server */ function restartPingInterval(reportingParams: PlaybackProgressInfo): void { @@ -55,7 +54,6 @@ export function stopPingInterval(): void { /** * Report to the server that playback has started. - * * @param state - playback state. * @param reportingParams - parameters to send to the server * @returns promise to wait for the request @@ -87,7 +85,6 @@ export function reportPlaybackStart( /** * Report to the server the progress of the playback. - * * @param state - playback state. * @param reportingParams - parameters for jellyfin * @param reportToServer - if jellyfin should be informed @@ -121,7 +118,6 @@ export function reportPlaybackProgress( /** * Report to the server that playback has stopped. - * * @param state - playback state. * @param reportingParams - parameters to send to the server * @returns promise for waiting for the request @@ -149,7 +145,6 @@ export function reportPlaybackStopped( * /Sessions/Playing/Progress does work but may not be called during pause. * The web client calls that during pause, but this endpoint gets the job done * as well. - * * @param reportingParams - progress information to carry * @returns promise for waiting for the request */ @@ -185,7 +180,6 @@ export function pingTranscoder( /** * Update the context about the item we are playing. - * * @param playbackMgr - playback manager. * @param customData - data to set on playback state. * @param serverItem - item that is playing @@ -224,7 +218,6 @@ export function load( * I also don't get doing nothing based on the currently visible app status * * TODO: rename these - * * @param state - playback state. */ export function play(state: PlaybackState): void { @@ -365,7 +358,6 @@ export function getLiveStream( * Get download speed based on the jellyfin bitratetest api. * * The API has a 10MB limit. - * * @param byteSize - number of bytes to request * @returns the bitrate in bits/s */ @@ -389,7 +381,6 @@ export async function getDownloadSpeed(byteSize: number): Promise { /** * Function to detect the bitrate. * It first tries 1MB and if bitrate is above 1Mbit/s it tries again with 2.4MB. - * * @returns bitrate in bits/s */ export async function detectBitrate(): Promise { @@ -408,7 +399,6 @@ export async function detectBitrate(): Promise { /** * Tell Jellyfin to kill off our active transcoding session - * * @param state - playback state. * @returns Promise for the http request to go through */ diff --git a/src/components/jellyfinApi.ts b/src/components/jellyfinApi.ts index 7e898c6f..5d47b344 100644 --- a/src/components/jellyfinApi.ts +++ b/src/components/jellyfinApi.ts @@ -109,7 +109,6 @@ export abstract class JellyfinApi { /** * Create url to image - * * @param itemId - Item id * @param imgType - Image type: Primary, Logo, Backdrop * @param imgTag - Image tag diff --git a/src/components/maincontroller.ts b/src/components/maincontroller.ts index 9a2bb935..b41f3e42 100644 --- a/src/components/maincontroller.ts +++ b/src/components/maincontroller.ts @@ -631,7 +631,6 @@ export async function shuffle( /** * This function fetches the full information of an item before playing it. * Only item.Id needs to be set. - * * @param item - Item to look up * @param options - Extra information about how it should be played back. * @returns Promise waiting for the item to be loaded for playback diff --git a/src/helpers.ts b/src/helpers.ts index f5b11c9e..290af95a 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -13,7 +13,6 @@ import { PlaybackState } from './components/playbackManager'; /** * Get current playback position in ticks, adjusted for server seeking - * * @param state - playback state. * @returns position in ticks */ @@ -30,7 +29,6 @@ export function getCurrentPositionTicks(state: PlaybackState): number { /** * Get parameters used for playback reporting - * * @param state - playback state. * @returns progress information for use with the reporting APIs */ @@ -61,7 +59,6 @@ export function getReportingParams(state: PlaybackState): PlaybackProgressInfo { /** * Get information about the next item to play from window.playlist - * * @returns ItemIndex including item and index, or null to end playback */ export function getNextPlaybackItemInfo(): ItemIndex | null { @@ -110,7 +107,6 @@ export function getNextPlaybackItemInfo(): ItemIndex | null { * This is used in playback reporting to find out information * about the item that is currently playing. This is sent over the cast protocol over to * the connected client (or clients?). - * * @param playbackState - playback state. * @param reportingData - object full of random information * @returns lots of data for the connected client @@ -211,7 +207,6 @@ export function getSenderReportingData( /** * Create CAF-native metadata for a given item - * * @param item - item to look up * @returns one of the metadata classes in cast.framework.messages.*Metadata */ @@ -320,7 +315,6 @@ export function getMetadata(item: BaseItemDto): any { /** * Create the necessary information about an item * needed for playback - * * @param item - Item to play * @param mediaSource - MediaSourceInfo for the item * @param startPosition - Where to seek to (possibly server seeking) @@ -476,7 +470,6 @@ export function createStreamInfo( /** * Get stream by its index while making a type assertion - * * @param streams - array streams to consider * @param type - type of stream * @param index - index of stream @@ -504,7 +497,6 @@ const requiredItemFields = 'MediaSources,Chapters'; * It's used only in maincomponents.shuffle. * * TODO: JellyfinApi.userId should be fine for this. - * * @param userId - User ID to look up items with * @param item - Parent item of shuffle search * @returns items for the queue @@ -540,7 +532,6 @@ export function getShuffleItems( * music artist, genre, album, playlist * * TODO: JellyfinApi.userId should be fine for this. - * * @param userId - User ID to look up items with * @param item - Parent item of the search * @returns items for the queue @@ -584,7 +575,6 @@ export async function getInstantMixItems( /** * Get items to be played back - * * @param userId - user for the search * @param query - specification on what to search for * @returns items to be played back @@ -622,7 +612,6 @@ export async function getItemsForPlayback( /** * Get episodes for a show given by seriesId - * * @param userId - userid to use * @param seriesId - series to look up * @param query - query parameters to build on @@ -647,7 +636,6 @@ export function getEpisodesForPlayback( /** * Get intros for a given item. This item should be a video * type for this to make sense - * * @param firstItem - item to get intros for * @returns intro items */ @@ -662,7 +650,6 @@ export function getIntros( /** * Get user object for the current user - * * @returns user object */ export function getUser(): Promise { @@ -675,8 +662,6 @@ export function getUser(): Promise { /** * Process a list of items for playback * by resolving things like folders to playable items. - * - * * @param userId - userId to use * @param items - items to resolve * @param smart - If enabled it will try to find the next episode given the current one, @@ -783,7 +768,6 @@ export async function translateRequestedItems( * Parse a date.. Just a wrapper around new Date, * but could be useful to deal with weird date strings * in the future. - * * @param date - string date to parse * @returns date object */ @@ -793,7 +777,6 @@ export function parseISO8601Date(date: string): Date { /** * Send a message over the custom message transport - * * @param message - to send */ export function broadcastToMessageBus(message: BusMessage): void {