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

Merge branch 'jellyfin:master' into master

This commit is contained in:
NathanGrenier 2025-03-28 00:46:55 -04:00 committed by GitHub
commit eec87d71c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 57 additions and 59 deletions

View file

@ -1,5 +1,5 @@
// 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 { MINIMUM_VERSION } from '@jellyfin/sdk/lib/versions';
import { ConnectionManager, Credentials, ApiClient } from 'jellyfin-apiclient';
@ -18,7 +18,6 @@ const normalizeImageOptions = options => {
};
const getMaxBandwidth = () => {
/* eslint-disable compat/compat */
if (navigator.connection) {
let max = navigator.connection.downlinkMax;
if (max && max > 0 && max < Number.POSITIVE_INFINITY) {
@ -28,7 +27,6 @@ const getMaxBandwidth = () => {
return parseInt(max, 10);
}
}
/* eslint-enable compat/compat */
return null;
};

View file

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

View file

@ -484,7 +484,7 @@ function getAirTimeText(item, showAirDateTime, showAirEndTime) {
airTimeText += ' - ' + datetime.getDisplayTime(date);
}
} catch (e) {
console.error('error parsing date: ' + item.StartDate);
console.error('error parsing date: ' + item.StartDate, e);
}
}
@ -617,7 +617,7 @@ function getCardFooterText(item, apiClient, options, footerClass, progressHtml,
datetime.parseISO8601Date(item.PremiereDate),
{ weekday: 'long', month: 'long', day: 'numeric' }
));
} catch (err) {
} catch {
lines.push('');
}
} else {

View file

@ -678,6 +678,7 @@ describe('getDefaultBackgroundClass', () => {
});
test('randomization string provided', () => {
// eslint-disable-next-line sonarjs/pseudo-random
const generateRandomString = (stringLength: number): string => (Math.random() + 1).toString(36).substring(stringLength);
for (let i = 0; i < 100; i++) {

View file

@ -14,6 +14,7 @@ function merge(resultItems, queryItems, delimiter) {
if (!queryItems) {
return resultItems;
}
// eslint-disable-next-line sonarjs/no-alphabetical-sort
return union(resultItems, queryItems.split(delimiter)).sort();
}

View file

@ -358,7 +358,7 @@ function Guide(options) {
if ((typeof date).toString().toLowerCase() === 'string') {
try {
date = datetime.parseISO8601Date(date, { toLocal: true });
} catch (err) {
} catch {
return date;
}
}
@ -392,7 +392,7 @@ function Guide(options) {
try {
program.StartDateLocal = datetime.parseISO8601Date(program.StartDate, { toLocal: true });
} catch (err) {
console.error('error parsing timestamp for start date');
console.error('error parsing timestamp for start date', err);
}
}
@ -400,7 +400,7 @@ function Guide(options) {
try {
program.EndDateLocal = datetime.parseISO8601Date(program.EndDate, { toLocal: true });
} catch (err) {
console.error('error parsing timestamp for end date');
console.error('error parsing timestamp for end date', err);
}
}

View file

@ -77,6 +77,7 @@ function setFiles(page, files) {
reader.readAsDataURL(file);
}
// eslint-disable-next-line sonarjs/no-invariant-returns
function onSubmit(e) {
const file = currentFile;

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 userSettings from '../../scripts/settings/userSettings';
import './style.scss';
// eslint-disable-next-line compat/compat
const worker = new Worker();
const targetDic = {};
worker.addEventListener(

View file

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

View file

@ -23,6 +23,7 @@ import toast from '../toast/toast';
import confirm from '../confirm/confirm';
import template from './mediaLibraryEditor.template.html';
// eslint-disable-next-line sonarjs/no-invariant-returns
function onEditLibrary() {
if (isCreating) {
return false;

View file

@ -60,7 +60,7 @@ function getProgramInfoHtml(item, options) {
miscInfo.push(text);
} catch (e) {
console.error('error parsing date:', item.StartDate);
console.error('error parsing date:', item.StartDate, e);
}
}
@ -140,7 +140,7 @@ export function getMediaInfoHtml(item, options = {}) {
text = datetime.toLocaleDateString(date);
miscInfo.push(text);
} catch (e) {
console.error('error parsing date:', item.PremiereDate);
console.error('error parsing date:', item.PremiereDate, e);
}
}
@ -170,7 +170,7 @@ export function getMediaInfoHtml(item, options = {}) {
miscInfo.push(text);
}
} catch (e) {
console.error('error parsing date:', item.StartDate);
console.error('error parsing date:', item.StartDate, e);
}
}
@ -188,7 +188,7 @@ export function getMediaInfoHtml(item, options = {}) {
text += ` - ${endYear}`;
}
} catch (e) {
console.error('error parsing date:', item.EndDate);
console.error('error parsing date:', item.EndDate, e);
}
}
@ -238,7 +238,7 @@ export function getMediaInfoHtml(item, options = {}) {
text = globalize.translate('OriginalAirDateValue', datetime.toLocaleDateString(date));
miscInfo.push(text);
} catch (e) {
console.error('error parsing date:', program.PremiereDate);
console.error('error parsing date:', program.PremiereDate, e);
}
} else if (program.ProductionYear && options.year !== false ) {
miscInfo.push(program.ProductionYear);
@ -255,7 +255,7 @@ export function getMediaInfoHtml(item, options = {}) {
text = datetime.toLocaleString(datetime.parseISO8601Date(item.PremiereDate).getFullYear(), { useGrouping: false });
miscInfo.push(text);
} catch (e) {
console.error('error parsing date:', item.PremiereDate);
console.error('error parsing date:', item.PremiereDate, e);
}
}
}

View file

@ -821,7 +821,7 @@ function fillItemInfo(context, item, parentalRatingOptions) {
date = datetime.parseISO8601Date(item.DateCreated, true);
context.querySelector('#txtDateAdded').value = date.toISOString().slice(0, 10);
} catch (e) {
} catch {
context.querySelector('#txtDateAdded').value = '';
}
} else {
@ -833,7 +833,7 @@ function fillItemInfo(context, item, parentalRatingOptions) {
date = datetime.parseISO8601Date(item.PremiereDate, true);
context.querySelector('#txtPremiereDate').value = date.toISOString().slice(0, 10);
} catch (e) {
} catch {
context.querySelector('#txtPremiereDate').value = '';
}
} else {
@ -845,7 +845,7 @@ function fillItemInfo(context, item, parentalRatingOptions) {
date = datetime.parseISO8601Date(item.EndDate, true);
context.querySelector('#txtEndDate').value = date.toISOString().slice(0, 10);
} catch (e) {
} catch {
context.querySelector('#txtEndDate').value = '';
}
} else {

View file

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

View file

@ -17,7 +17,6 @@ Events.on(playbackManager, 'playbackstart', function (e, player) {
const isLocalVideo = player.isLocalPlayer && !player.isExternalPlayer && playbackManager.isPlayingVideo(player);
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);
if (lockOrientation) {
@ -38,7 +37,6 @@ Events.on(playbackManager, 'playbackstart', function (e, player) {
Events.on(playbackManager, 'playbackstop', function (e, playbackStopInfo) {
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);
if (unlockOrientation) {