1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix autofixable eslint warnings

This commit is contained in:
Bill Thornton 2025-03-27 11:32:16 -04:00
parent b885cfdc83
commit 9077782c17
11 changed files with 20 additions and 28 deletions

View file

@ -1,5 +1,5 @@
// NOTE: This is used for jsdoc return type // NOTE: This is used for jsdoc return type
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Api } from '@jellyfin/sdk'; import { Api } from '@jellyfin/sdk';
import { MINIMUM_VERSION } from '@jellyfin/sdk/lib/versions'; import { MINIMUM_VERSION } from '@jellyfin/sdk/lib/versions';
import { ConnectionManager, Credentials, ApiClient } from 'jellyfin-apiclient'; import { ConnectionManager, Credentials, ApiClient } from 'jellyfin-apiclient';
@ -18,7 +18,6 @@ const normalizeImageOptions = options => {
}; };
const getMaxBandwidth = () => { const getMaxBandwidth = () => {
/* eslint-disable compat/compat */
if (navigator.connection) { if (navigator.connection) {
let max = navigator.connection.downlinkMax; let max = navigator.connection.downlinkMax;
if (max && max > 0 && max < Number.POSITIVE_INFINITY) { if (max && max > 0 && max < Number.POSITIVE_INFINITY) {
@ -28,7 +27,6 @@ const getMaxBandwidth = () => {
return parseInt(max, 10); return parseInt(max, 10);
} }
} }
/* eslint-enable compat/compat */
return null; return null;
}; };

View file

@ -452,7 +452,7 @@ let isHidden = false;
let hidden; let hidden;
let visibilityChange; let visibilityChange;
if (typeof document.hidden !== 'undefined') { /* eslint-disable-line compat/compat */ if (typeof document.hidden !== 'undefined') {
hidden = 'hidden'; hidden = 'hidden';
visibilityChange = 'visibilitychange'; visibilityChange = 'visibilitychange';
} else if (typeof document.webkitHidden !== 'undefined') { } else if (typeof document.webkitHidden !== 'undefined') {
@ -461,7 +461,6 @@ if (typeof document.hidden !== 'undefined') { /* eslint-disable-line compat/comp
} }
document.addEventListener(visibilityChange, function () { document.addEventListener(visibilityChange, function () {
/* eslint-disable-next-line compat/compat */
if (document[hidden]) { if (document[hidden]) {
onAppHidden(); onAppHidden();
} else { } else {

View file

@ -2,7 +2,7 @@ import Worker from './blurhash.worker.ts'; // eslint-disable-line import/default
import * as lazyLoader from '../lazyLoader/lazyLoaderIntersectionObserver'; import * as lazyLoader from '../lazyLoader/lazyLoaderIntersectionObserver';
import * as userSettings from '../../scripts/settings/userSettings'; import * as userSettings from '../../scripts/settings/userSettings';
import './style.scss'; import './style.scss';
// eslint-disable-next-line compat/compat
const worker = new Worker(); const worker = new Worker();
const targetDic = {}; const targetDic = {};
worker.addEventListener( worker.addEventListener(

View file

@ -25,7 +25,6 @@ const Lists: FC<ListsProps> = ({ items = [], listOptions = {} }) => {
const renderListItem = (item: ItemDto, index: number) => { const renderListItem = (item: ItemDto, index: number) => {
return ( return (
<List <List
// eslint-disable-next-line react/no-array-index-key
key={`${item.Id}-${index}`} key={`${item.Id}-${index}`}
index={index} index={index}
item={item} item={item}

View file

@ -13,7 +13,6 @@ function onOneDocumentClick() {
// don't request notification permissions if they're already granted or denied // don't request notification permissions if they're already granted or denied
if (window.Notification && window.Notification.permission === 'default') { if (window.Notification && window.Notification.permission === 'default') {
/* eslint-disable-next-line compat/compat */
Notification.requestPermission(); Notification.requestPermission();
} }
} }

View file

@ -17,7 +17,6 @@ Events.on(playbackManager, 'playbackstart', function (e, player) {
const isLocalVideo = player.isLocalPlayer && !player.isExternalPlayer && playbackManager.isPlayingVideo(player); const isLocalVideo = player.isLocalPlayer && !player.isExternalPlayer && playbackManager.isPlayingVideo(player);
if (isLocalVideo && layoutManager.mobile) { if (isLocalVideo && layoutManager.mobile) {
/* eslint-disable-next-line compat/compat */
const lockOrientation = window.screen.lockOrientation || window.screen.mozLockOrientation || window.screen.msLockOrientation || (window.screen.orientation?.lock); const lockOrientation = window.screen.lockOrientation || window.screen.mozLockOrientation || window.screen.msLockOrientation || (window.screen.orientation?.lock);
if (lockOrientation) { if (lockOrientation) {
@ -38,7 +37,6 @@ Events.on(playbackManager, 'playbackstart', function (e, player) {
Events.on(playbackManager, 'playbackstop', function (e, playbackStopInfo) { Events.on(playbackManager, 'playbackstop', function (e, playbackStopInfo) {
if (orientationLocked && !playbackStopInfo.nextMediaType) { if (orientationLocked && !playbackStopInfo.nextMediaType) {
/* eslint-disable-next-line compat/compat */
const unlockOrientation = window.screen.unlockOrientation || window.screen.mozUnlockOrientation || window.screen.msUnlockOrientation || (window.screen.orientation?.unlock); const unlockOrientation = window.screen.unlockOrientation || window.screen.mozUnlockOrientation || window.screen.msUnlockOrientation || (window.screen.orientation?.unlock);
if (unlockOrientation) { if (unlockOrientation) {

View file

@ -1352,7 +1352,7 @@ export default function (view) {
case 'GamepadDPadLeft': case 'GamepadDPadLeft':
case 'GamepadLeftThumbstickLeft': case 'GamepadLeftThumbstickLeft':
// Ignores gamepad events that are always triggered, even when not focused. // Ignores gamepad events that are always triggered, even when not focused.
if (document.hasFocus()) { /* eslint-disable-line compat/compat */ if (document.hasFocus()) {
playbackManager.rewind(currentPlayer); playbackManager.rewind(currentPlayer);
showOsd(btnRewind); showOsd(btnRewind);
} }
@ -1361,7 +1361,7 @@ export default function (view) {
case 'GamepadDPadRight': case 'GamepadDPadRight':
case 'GamepadLeftThumbstickRight': case 'GamepadLeftThumbstickRight':
// Ignores gamepad events that are always triggered, even when not focused. // Ignores gamepad events that are always triggered, even when not focused.
if (document.hasFocus()) { /* eslint-disable-line compat/compat */ if (document.hasFocus()) {
playbackManager.fastForward(currentPlayer); playbackManager.fastForward(currentPlayer);
showOsd(btnFastForward); showOsd(btnFastForward);
} }

View file

@ -1109,7 +1109,8 @@ class ChromecastPlayer {
return this.getPlayerStateInternal()?.NowPlayingItem?.IndexNumber; return this.getPlayerStateInternal()?.NowPlayingItem?.IndexNumber;
} }
clearQueue(currentTime) { // eslint-disable-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
clearQueue(currentTime) {
// not supported yet // not supported yet
} }
} }

View file

@ -158,7 +158,7 @@ class GenericPlayer {
* Sets the playback rate, if supported. * Sets the playback rate, if supported.
* @param {number} value The playback rate. * @param {number} value The playback rate.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
setPlaybackRate(value) { setPlaybackRate(value) {
// Do nothing. // Do nothing.
} }
@ -197,7 +197,7 @@ class GenericPlayer {
* Seeks the player to the specified position. * Seeks the player to the specified position.
* @param {number} positionTicks The new position. * @param {number} positionTicks The new position.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localSeek(positionTicks) { localSeek(positionTicks) {
// Override // Override
} }
@ -213,7 +213,7 @@ class GenericPlayer {
* Sends a command to the player. * Sends a command to the player.
* @param {Object} command The command. * @param {Object} command The command.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localSendCommand(command) { localSendCommand(command) {
// Override // Override
} }
@ -222,7 +222,7 @@ class GenericPlayer {
* Starts playback. * Starts playback.
* @param {Object} options Playback data. * @param {Object} options Playback data.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localPlay(options) { localPlay(options) {
// Override // Override
} }
@ -231,7 +231,7 @@ class GenericPlayer {
* Sets playing item from playlist. * Sets playing item from playlist.
* @param {string} playlistItemId The item to play. * @param {string} playlistItemId The item to play.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localSetCurrentPlaylistItem(playlistItemId) { localSetCurrentPlaylistItem(playlistItemId) {
// Override // Override
} }
@ -240,7 +240,7 @@ class GenericPlayer {
* Removes items from playlist. * Removes items from playlist.
* @param {Array} playlistItemIds The items to remove. * @param {Array} playlistItemIds The items to remove.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localRemoveFromPlaylist(playlistItemIds) { localRemoveFromPlaylist(playlistItemIds) {
// Override // Override
} }
@ -250,7 +250,7 @@ class GenericPlayer {
* @param {string} playlistItemId The item to move. * @param {string} playlistItemId The item to move.
* @param {number} newIndex The new position. * @param {number} newIndex The new position.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localMovePlaylistItem(playlistItemId, newIndex) { localMovePlaylistItem(playlistItemId, newIndex) {
// Override // Override
} }
@ -259,7 +259,7 @@ class GenericPlayer {
* Queues in the playlist. * Queues in the playlist.
* @param {Object} options Queue data. * @param {Object} options Queue data.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localQueue(options) { localQueue(options) {
// Override // Override
} }
@ -268,7 +268,7 @@ class GenericPlayer {
* Queues after the playing item in the playlist. * Queues after the playing item in the playlist.
* @param {Object} options Queue data. * @param {Object} options Queue data.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localQueueNext(options) { localQueueNext(options) {
// Override // Override
} }
@ -291,7 +291,7 @@ class GenericPlayer {
* Sets repeat mode. * Sets repeat mode.
* @param {string} value The repeat mode. * @param {string} value The repeat mode.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localSetRepeatMode(value) { localSetRepeatMode(value) {
// Override // Override
} }
@ -300,7 +300,7 @@ class GenericPlayer {
* Sets shuffle mode. * Sets shuffle mode.
* @param {string} value The shuffle mode. * @param {string} value The shuffle mode.
*/ */
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
localSetQueueShuffleMode(value) { localSetQueueShuffleMode(value) {
// Override // Override
} }

View file

@ -178,7 +178,7 @@ function resetThrottle(key) {
const isElectron = navigator.userAgent.toLowerCase().indexOf('electron') !== -1; const isElectron = navigator.userAgent.toLowerCase().indexOf('electron') !== -1;
function allowInput() { function allowInput() {
// This would be nice but always seems to return true with electron // This would be nice but always seems to return true with electron
if (!isElectron && document.hidden) { /* eslint-disable-line compat/compat */ if (!isElectron && document.hidden) {
return false; return false;
} }
@ -356,7 +356,6 @@ function isGamepadConnected() {
} }
function onFocusOrGamepadAttach() { function onFocusOrGamepadAttach() {
/* eslint-disable-next-line compat/compat */
if (isGamepadConnected() && document.hasFocus()) { if (isGamepadConnected() && document.hasFocus()) {
console.log('Gamepad connected! Starting input loop'); console.log('Gamepad connected! Starting input loop');
startInputLoop(); startInputLoop();
@ -364,7 +363,6 @@ function onFocusOrGamepadAttach() {
} }
function onFocusOrGamepadDetach() { function onFocusOrGamepadDetach() {
/* eslint-disable-next-line compat/compat */
if (!isGamepadConnected() || !document.hasFocus()) { if (!isGamepadConnected() || !document.hasFocus()) {
console.log('Gamepad disconnected! No other gamepads are connected, stopping input loop'); console.log('Gamepad disconnected! No other gamepads are connected, stopping input loop');
stopInputLoop(); stopInputLoop();

View file

@ -239,7 +239,7 @@ function attachGamepadScript() {
} }
// No need to check for gamepads manually at load time, the eventhandler will be fired for that // No need to check for gamepads manually at load time, the eventhandler will be fired for that
if (navigator.getGamepads && appSettings.enableGamepad()) { /* eslint-disable-line compat/compat */ if (navigator.getGamepads && appSettings.enableGamepad()) {
window.addEventListener('gamepadconnected', attachGamepadScript); window.addEventListener('gamepadconnected', attachGamepadScript);
} }