Enable eslint array-callback-return foreach checking
This commit is contained in:
parent
aabbc8920f
commit
858aea92f9
5 changed files with 18 additions and 7 deletions
|
@ -34,7 +34,7 @@ module.exports = {
|
||||||
'plugin:sonarjs/recommended'
|
'plugin:sonarjs/recommended'
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
'array-callback-return': ['error'],
|
'array-callback-return': ['error', { 'checkForEach': true }],
|
||||||
'block-spacing': ['error'],
|
'block-spacing': ['error'],
|
||||||
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
|
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
|
||||||
'comma-dangle': ['error', 'never'],
|
'comma-dangle': ['error', 'never'],
|
||||||
|
|
|
@ -159,11 +159,15 @@ import { Events } from 'jellyfin-apiclient';
|
||||||
// (but rewinding cannot happen as the first event with media of non-empty duration)
|
// (but rewinding cannot happen as the first event with media of non-empty duration)
|
||||||
console.debug(`seeking to ${seconds} on ${e.type} event`);
|
console.debug(`seeking to ${seconds} on ${e.type} event`);
|
||||||
setCurrentTimeIfNeeded(element, seconds);
|
setCurrentTimeIfNeeded(element, seconds);
|
||||||
events.forEach(name => element.removeEventListener(name, onMediaChange));
|
events.forEach(name => {
|
||||||
|
element.removeEventListener(name, onMediaChange);
|
||||||
|
});
|
||||||
if (onMediaReady) onMediaReady();
|
if (onMediaReady) onMediaReady();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
events.forEach(name => element.addEventListener(name, onMediaChange));
|
events.forEach(name => {
|
||||||
|
element.addEventListener(name, onMediaChange);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,8 +205,12 @@ function renderTrackSelections(page, instance, item, forceReload) {
|
||||||
});
|
});
|
||||||
|
|
||||||
mediaSources = [];
|
mediaSources = [];
|
||||||
resolutionNames.forEach(v => mediaSources.push(v));
|
resolutionNames.forEach(v => {
|
||||||
sourceNames.forEach(v => mediaSources.push(v));
|
mediaSources.push(v);
|
||||||
|
});
|
||||||
|
sourceNames.forEach(v => {
|
||||||
|
mediaSources.push(v);
|
||||||
|
});
|
||||||
|
|
||||||
instance._currentPlaybackMediaSources = mediaSources;
|
instance._currentPlaybackMediaSources = mediaSources;
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,8 @@ export default function (urls) {
|
||||||
urls.forEach(function (url) {
|
urls.forEach(function (url) {
|
||||||
// the download init has to be sequential for firefox if the urls are not on the same domain
|
// the download init has to be sequential for firefox if the urls are not on the same domain
|
||||||
if (browser.firefox && !sameDomain(url)) {
|
if (browser.firefox && !sameDomain(url)) {
|
||||||
return setTimeout(download.bind(null, url), 100 * ++delay);
|
setTimeout(download.bind(null, url), 100 * ++delay);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
download(url);
|
download(url);
|
||||||
|
|
|
@ -43,7 +43,9 @@ export default {
|
||||||
*/
|
*/
|
||||||
downloadFiles(items) {
|
downloadFiles(items) {
|
||||||
if (window.NativeShell?.downloadFile) {
|
if (window.NativeShell?.downloadFile) {
|
||||||
items.forEach(item => window.NativeShell.downloadFile(item));
|
items.forEach(item => {
|
||||||
|
window.NativeShell.downloadFile(item);
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue