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:
commit
eec87d71c1
32 changed files with 57 additions and 59 deletions
|
@ -98,7 +98,7 @@ export default tseslint.config(
|
||||||
|
|
||||||
'sonarjs/fixme-tag': 'warn',
|
'sonarjs/fixme-tag': 'warn',
|
||||||
'sonarjs/todo-tag': 'off',
|
'sonarjs/todo-tag': 'off',
|
||||||
'sonarjs/deprecation': 'warn',
|
'sonarjs/deprecation': 'off',
|
||||||
'sonarjs/no-alphabetical-sort': 'warn',
|
'sonarjs/no-alphabetical-sort': 'warn',
|
||||||
'sonarjs/no-inverted-boolean-check': 'error',
|
'sonarjs/no-inverted-boolean-check': 'error',
|
||||||
'sonarjs/no-selector-parameter': 'off',
|
'sonarjs/no-selector-parameter': 'off',
|
||||||
|
@ -329,6 +329,7 @@ export default tseslint.config(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
'@typescript-eslint/no-deprecated': 'warn',
|
||||||
'@typescript-eslint/no-floating-promises': 'error',
|
'@typescript-eslint/no-floating-promises': 'error',
|
||||||
'@typescript-eslint/prefer-string-starts-ends-with': 'error'
|
'@typescript-eslint/prefer-string-starts-ends-with': 'error'
|
||||||
}
|
}
|
||||||
|
@ -366,7 +367,6 @@ export default tseslint.config(
|
||||||
rules: {
|
rules: {
|
||||||
'@typescript-eslint/no-floating-promises': 'off',
|
'@typescript-eslint/no-floating-promises': 'off',
|
||||||
'@typescript-eslint/no-this-alias': 'off',
|
'@typescript-eslint/no-this-alias': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': 'warn',
|
|
||||||
|
|
||||||
'sonarjs/public-static-readonly': 'off',
|
'sonarjs/public-static-readonly': 'off',
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -484,7 +484,7 @@ function getAirTimeText(item, showAirDateTime, showAirEndTime) {
|
||||||
airTimeText += ' - ' + datetime.getDisplayTime(date);
|
airTimeText += ' - ' + datetime.getDisplayTime(date);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} 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),
|
datetime.parseISO8601Date(item.PremiereDate),
|
||||||
{ weekday: 'long', month: 'long', day: 'numeric' }
|
{ weekday: 'long', month: 'long', day: 'numeric' }
|
||||||
));
|
));
|
||||||
} catch (err) {
|
} catch {
|
||||||
lines.push('');
|
lines.push('');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -678,6 +678,7 @@ describe('getDefaultBackgroundClass', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('randomization string provided', () => {
|
test('randomization string provided', () => {
|
||||||
|
// eslint-disable-next-line sonarjs/pseudo-random
|
||||||
const generateRandomString = (stringLength: number): string => (Math.random() + 1).toString(36).substring(stringLength);
|
const generateRandomString = (stringLength: number): string => (Math.random() + 1).toString(36).substring(stringLength);
|
||||||
|
|
||||||
for (let i = 0; i < 100; i++) {
|
for (let i = 0; i < 100; i++) {
|
||||||
|
|
|
@ -14,6 +14,7 @@ function merge(resultItems, queryItems, delimiter) {
|
||||||
if (!queryItems) {
|
if (!queryItems) {
|
||||||
return resultItems;
|
return resultItems;
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line sonarjs/no-alphabetical-sort
|
||||||
return union(resultItems, queryItems.split(delimiter)).sort();
|
return union(resultItems, queryItems.split(delimiter)).sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ function Guide(options) {
|
||||||
if ((typeof date).toString().toLowerCase() === 'string') {
|
if ((typeof date).toString().toLowerCase() === 'string') {
|
||||||
try {
|
try {
|
||||||
date = datetime.parseISO8601Date(date, { toLocal: true });
|
date = datetime.parseISO8601Date(date, { toLocal: true });
|
||||||
} catch (err) {
|
} catch {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ function Guide(options) {
|
||||||
try {
|
try {
|
||||||
program.StartDateLocal = datetime.parseISO8601Date(program.StartDate, { toLocal: true });
|
program.StartDateLocal = datetime.parseISO8601Date(program.StartDate, { toLocal: true });
|
||||||
} catch (err) {
|
} 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 {
|
try {
|
||||||
program.EndDateLocal = datetime.parseISO8601Date(program.EndDate, { toLocal: true });
|
program.EndDateLocal = datetime.parseISO8601Date(program.EndDate, { toLocal: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('error parsing timestamp for end date');
|
console.error('error parsing timestamp for end date', err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,7 @@ function setFiles(page, files) {
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line sonarjs/no-invariant-returns
|
||||||
function onSubmit(e) {
|
function onSubmit(e) {
|
||||||
const file = currentFile;
|
const file = currentFile;
|
||||||
|
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import toast from '../toast/toast';
|
||||||
import confirm from '../confirm/confirm';
|
import confirm from '../confirm/confirm';
|
||||||
import template from './mediaLibraryEditor.template.html';
|
import template from './mediaLibraryEditor.template.html';
|
||||||
|
|
||||||
|
// eslint-disable-next-line sonarjs/no-invariant-returns
|
||||||
function onEditLibrary() {
|
function onEditLibrary() {
|
||||||
if (isCreating) {
|
if (isCreating) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -60,7 +60,7 @@ function getProgramInfoHtml(item, options) {
|
||||||
|
|
||||||
miscInfo.push(text);
|
miscInfo.push(text);
|
||||||
} catch (e) {
|
} 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);
|
text = datetime.toLocaleDateString(date);
|
||||||
miscInfo.push(text);
|
miscInfo.push(text);
|
||||||
} catch (e) {
|
} 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);
|
miscInfo.push(text);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} 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}`;
|
text += ` - ${endYear}`;
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} 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));
|
text = globalize.translate('OriginalAirDateValue', datetime.toLocaleDateString(date));
|
||||||
miscInfo.push(text);
|
miscInfo.push(text);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('error parsing date:', program.PremiereDate);
|
console.error('error parsing date:', program.PremiereDate, e);
|
||||||
}
|
}
|
||||||
} else if (program.ProductionYear && options.year !== false ) {
|
} else if (program.ProductionYear && options.year !== false ) {
|
||||||
miscInfo.push(program.ProductionYear);
|
miscInfo.push(program.ProductionYear);
|
||||||
|
@ -255,7 +255,7 @@ export function getMediaInfoHtml(item, options = {}) {
|
||||||
text = datetime.toLocaleString(datetime.parseISO8601Date(item.PremiereDate).getFullYear(), { useGrouping: false });
|
text = datetime.toLocaleString(datetime.parseISO8601Date(item.PremiereDate).getFullYear(), { useGrouping: false });
|
||||||
miscInfo.push(text);
|
miscInfo.push(text);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('error parsing date:', item.PremiereDate);
|
console.error('error parsing date:', item.PremiereDate, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -821,7 +821,7 @@ function fillItemInfo(context, item, parentalRatingOptions) {
|
||||||
date = datetime.parseISO8601Date(item.DateCreated, true);
|
date = datetime.parseISO8601Date(item.DateCreated, true);
|
||||||
|
|
||||||
context.querySelector('#txtDateAdded').value = date.toISOString().slice(0, 10);
|
context.querySelector('#txtDateAdded').value = date.toISOString().slice(0, 10);
|
||||||
} catch (e) {
|
} catch {
|
||||||
context.querySelector('#txtDateAdded').value = '';
|
context.querySelector('#txtDateAdded').value = '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -833,7 +833,7 @@ function fillItemInfo(context, item, parentalRatingOptions) {
|
||||||
date = datetime.parseISO8601Date(item.PremiereDate, true);
|
date = datetime.parseISO8601Date(item.PremiereDate, true);
|
||||||
|
|
||||||
context.querySelector('#txtPremiereDate').value = date.toISOString().slice(0, 10);
|
context.querySelector('#txtPremiereDate').value = date.toISOString().slice(0, 10);
|
||||||
} catch (e) {
|
} catch {
|
||||||
context.querySelector('#txtPremiereDate').value = '';
|
context.querySelector('#txtPremiereDate').value = '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -845,7 +845,7 @@ function fillItemInfo(context, item, parentalRatingOptions) {
|
||||||
date = datetime.parseISO8601Date(item.EndDate, true);
|
date = datetime.parseISO8601Date(item.EndDate, true);
|
||||||
|
|
||||||
context.querySelector('#txtEndDate').value = date.toISOString().slice(0, 10);
|
context.querySelector('#txtEndDate').value = date.toISOString().slice(0, 10);
|
||||||
} catch (e) {
|
} catch {
|
||||||
context.querySelector('#txtEndDate').value = '';
|
context.querySelector('#txtEndDate').value = '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -265,7 +265,7 @@ export default function (view) {
|
||||||
document.addEventListener('keydown', onKeyDown);
|
document.addEventListener('keydown', onKeyDown);
|
||||||
try {
|
try {
|
||||||
onLoad();
|
onLoad();
|
||||||
} catch (e) {
|
} catch {
|
||||||
appRouter.goHome();
|
appRouter.goHome();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -713,7 +713,7 @@ export default function (view) {
|
||||||
}, state);
|
}, state);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('error parsing date: ' + program.EndDate);
|
console.error('error parsing date: ' + program.EndDate, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -1712,7 +1712,7 @@ export default function (view) {
|
||||||
if (browser.firefox || browser.edge) {
|
if (browser.firefox || browser.edge) {
|
||||||
dom.addEventListener(document, 'click', onClickCapture, { capture: true });
|
dom.addEventListener(document, 'click', onClickCapture, { capture: true });
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch {
|
||||||
setBackdropTransparency(TRANSPARENCY_LEVEL.None); // reset state set in viewbeforeshow
|
setBackdropTransparency(TRANSPARENCY_LEVEL.None); // reset state set in viewbeforeshow
|
||||||
appRouter.goHome();
|
appRouter.goHome();
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ function renderUpcoming(elem, items) {
|
||||||
day: 'numeric'
|
day: 'numeric'
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('error parsing timestamp for upcoming tv shows');
|
console.error('error parsing timestamp for upcoming tv shows', err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ export function updateCurrentCulture() {
|
||||||
let culture;
|
let culture;
|
||||||
try {
|
try {
|
||||||
culture = userSettings.language();
|
culture = userSettings.language();
|
||||||
} catch (err) {
|
} catch {
|
||||||
console.error('no language set in user settings');
|
console.error('no language set in user settings');
|
||||||
}
|
}
|
||||||
culture = culture || getDefaultLanguage();
|
culture = culture || getDefaultLanguage();
|
||||||
|
@ -92,7 +92,7 @@ export function updateCurrentCulture() {
|
||||||
let dateTimeCulture;
|
let dateTimeCulture;
|
||||||
try {
|
try {
|
||||||
dateTimeCulture = userSettings.dateTimeLocale();
|
dateTimeCulture = userSettings.dateTimeLocale();
|
||||||
} catch (err) {
|
} catch {
|
||||||
console.error('no date format set in user settings');
|
console.error('no date format set in user settings');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// text/html parsing is natively supported
|
// text/html parsing is natively supported
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (ex) { /* noop */ }
|
} catch { /* noop */ }
|
||||||
|
|
||||||
DOMParserPrototype.parseFromString = function (markup, type) {
|
DOMParserPrototype.parseFromString = function (markup, type) {
|
||||||
if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
|
if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
try {
|
try {
|
||||||
new window.KeyboardEvent('event', { bubbles: true, cancelable: true });
|
new window.KeyboardEvent('event', { bubbles: true, cancelable: true });
|
||||||
} catch (e) {
|
} catch {
|
||||||
// We can't use `KeyboardEvent` in old WebKit because `initKeyboardEvent`
|
// We can't use `KeyboardEvent` in old WebKit because `initKeyboardEvent`
|
||||||
// doesn't seem to populate some properties (`keyCode`, `which`) that
|
// doesn't seem to populate some properties (`keyCode`, `which`) that
|
||||||
// are read-only.
|
// are read-only.
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
if (window.Headers) {
|
if (window.Headers) {
|
||||||
try {
|
try {
|
||||||
new window.Headers(undefined);
|
new window.Headers(undefined);
|
||||||
} catch (_) {
|
} catch {
|
||||||
console.debug('patch \'Headers\' to accept \'undefined\'');
|
console.debug('patch \'Headers\' to accept \'undefined\'');
|
||||||
|
|
||||||
const _Headers = window.Headers;
|
const _Headers = window.Headers;
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1512,7 +1512,7 @@ export class HtmlVideoPlayer {
|
||||||
trackElement.removeCue(trackElement.cues[0]);
|
trackElement.removeCue(trackElement.cues[0]);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('error removing cue from textTrack');
|
console.error('error removing cue from textTrack', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
trackElement.mode = 'disabled';
|
trackElement.mode = 'disabled';
|
||||||
|
|
|
@ -221,6 +221,7 @@ class PlaybackCore {
|
||||||
// Account for player imperfections, we got half a second of tollerance we can play with
|
// Account for player imperfections, we got half a second of tollerance we can play with
|
||||||
// (the server tollerates a range of values when client reports that is ready).
|
// (the server tollerates a range of values when client reports that is ready).
|
||||||
const rangeWidth = 100; // In milliseconds.
|
const rangeWidth = 100; // In milliseconds.
|
||||||
|
// eslint-disable-next-line sonarjs/pseudo-random
|
||||||
const randomOffsetTicks = Math.round((Math.random() - 0.5) * rangeWidth) * Helper.TicksPerMillisecond;
|
const randomOffsetTicks = Math.round((Math.random() - 0.5) * rangeWidth) * Helper.TicksPerMillisecond;
|
||||||
this.scheduleSeek(command.When, command.PositionTicks + randomOffsetTicks);
|
this.scheduleSeek(command.When, command.PositionTicks + randomOffsetTicks);
|
||||||
console.debug('SyncPlay applyCommand: adding random offset to force seek:', randomOffsetTicks, command);
|
console.debug('SyncPlay applyCommand: adding random offset to force seek:', randomOffsetTicks, command);
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,7 @@ export function getDisplayDateTime(date) {
|
||||||
if (typeof date === 'string') {
|
if (typeof date === 'string') {
|
||||||
try {
|
try {
|
||||||
date = parseISO8601Date(date, true);
|
date = parseISO8601Date(date, true);
|
||||||
} catch (err) {
|
} catch {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ export function getDisplayTime(date) {
|
||||||
if (typeof date === 'string') {
|
if (typeof date === 'string') {
|
||||||
try {
|
try {
|
||||||
date = parseISO8601Date(date, true);
|
date = parseISO8601Date(date, true);
|
||||||
} catch (err) {
|
} catch {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -64,7 +64,7 @@ let hasFieldKey = false;
|
||||||
try {
|
try {
|
||||||
hasFieldKey = 'key' in new KeyboardEvent('keydown');
|
hasFieldKey = 'key' in new KeyboardEvent('keydown');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("error checking 'key' field");
|
console.error("error checking 'key' field", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasFieldKey) {
|
if (!hasFieldKey) {
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ function getScreensaverPlugin(isLoggedIn) {
|
||||||
let option;
|
let option;
|
||||||
try {
|
try {
|
||||||
option = userSettings.get('screensaver', false);
|
option = userSettings.get('screensaver', false);
|
||||||
} catch (err) {
|
} catch {
|
||||||
option = isLoggedIn ? 'backdropscreensaver' : 'logoscreensaver';
|
option = isLoggedIn ? 'backdropscreensaver' : 'logoscreensaver';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ export async function serverAddress() {
|
||||||
let config;
|
let config;
|
||||||
try {
|
try {
|
||||||
config = await resp.json();
|
config = await resp.json();
|
||||||
} catch (err) {
|
} catch {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ function toLocaleStringSupportsOptions() {
|
||||||
* @returns {number} Randomly generated number.
|
* @returns {number} Randomly generated number.
|
||||||
*/
|
*/
|
||||||
export function randomInt(min: number, max: number): number {
|
export function randomInt(min: number, max: number): number {
|
||||||
|
// eslint-disable-next-line sonarjs/pseudo-random
|
||||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue