mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix invalid uses of Array.map
This commit is contained in:
parent
14dc03ab7d
commit
310e8b713f
4 changed files with 7 additions and 11 deletions
|
@ -157,9 +157,7 @@ import confirm from '../confirm/confirm';
|
||||||
}
|
}
|
||||||
|
|
||||||
confirm(msg, title).then(() => {
|
confirm(msg, title).then(() => {
|
||||||
const promises = itemIds.map(itemId => {
|
const promises = itemIds.map(itemId => apiClient.deleteItem(itemId));
|
||||||
apiClient.deleteItem(itemId);
|
|
||||||
});
|
|
||||||
|
|
||||||
Promise.all(promises).then(resolve, () => {
|
Promise.all(promises).then(resolve, () => {
|
||||||
alertText(globalize.translate('ErrorDeletingItem')).then(reject, reject);
|
alertText(globalize.translate('ErrorDeletingItem')).then(reject, reject);
|
||||||
|
|
|
@ -283,9 +283,9 @@ function getAudioMaxValues(deviceProfile) {
|
||||||
let maxAudioBitDepth = null;
|
let maxAudioBitDepth = null;
|
||||||
let maxAudioBitrate = null;
|
let maxAudioBitrate = null;
|
||||||
|
|
||||||
deviceProfile.CodecProfiles.map(function (codecProfile) {
|
deviceProfile.CodecProfiles.forEach(codecProfile => {
|
||||||
if (codecProfile.Type === 'Audio') {
|
if (codecProfile.Type === 'Audio') {
|
||||||
(codecProfile.Conditions || []).map(function (condition) {
|
(codecProfile.Conditions || []).forEach(condition => {
|
||||||
if (condition.Condition === 'LessThanEqual' && condition.Property === 'AudioBitDepth') {
|
if (condition.Condition === 'LessThanEqual' && condition.Property === 'AudioBitDepth') {
|
||||||
return maxAudioBitDepth = condition.Value;
|
return maxAudioBitDepth = condition.Value;
|
||||||
} else if (condition.Condition === 'LessThanEqual' && condition.Property === 'AudioSampleRate') {
|
} else if (condition.Condition === 'LessThanEqual' && condition.Property === 'AudioSampleRate') {
|
||||||
|
@ -334,7 +334,7 @@ function getAudioStreamUrlFromDeviceProfile(item, deviceProfile, maxBitrate, api
|
||||||
|
|
||||||
let directPlayContainers = '';
|
let directPlayContainers = '';
|
||||||
|
|
||||||
deviceProfile.DirectPlayProfiles.map(function (p) {
|
deviceProfile.DirectPlayProfiles.forEach(p => {
|
||||||
if (p.Type === 'Audio') {
|
if (p.Type === 'Audio') {
|
||||||
if (directPlayContainers) {
|
if (directPlayContainers) {
|
||||||
directPlayContainers += ',' + p.Container;
|
directPlayContainers += ',' + p.Container;
|
||||||
|
@ -360,7 +360,7 @@ function getStreamUrls(items, deviceProfile, maxBitrate, apiClient, startPositio
|
||||||
|
|
||||||
let audioDirectPlayContainers = '';
|
let audioDirectPlayContainers = '';
|
||||||
|
|
||||||
deviceProfile.DirectPlayProfiles.map(function (p) {
|
deviceProfile.DirectPlayProfiles.forEach(p => {
|
||||||
if (p.Type === 'Audio') {
|
if (p.Type === 'Audio') {
|
||||||
if (audioDirectPlayContainers) {
|
if (audioDirectPlayContainers) {
|
||||||
audioDirectPlayContainers += ',' + p.Container;
|
audioDirectPlayContainers += ',' + p.Container;
|
||||||
|
|
|
@ -86,7 +86,7 @@ function unsubscribeFromPlayerUpdates(instance) {
|
||||||
function processUpdatedSessions(instance, sessions, apiClient) {
|
function processUpdatedSessions(instance, sessions, apiClient) {
|
||||||
const serverId = apiClient.serverId();
|
const serverId = apiClient.serverId();
|
||||||
|
|
||||||
sessions.map(function (s) {
|
sessions.forEach(s => {
|
||||||
if (s.NowPlayingItem) {
|
if (s.NowPlayingItem) {
|
||||||
s.NowPlayingItem.ServerId = serverId;
|
s.NowPlayingItem.ServerId = serverId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
downloadFiles(items) {
|
downloadFiles(items) {
|
||||||
if (window.NativeShell) {
|
if (window.NativeShell) {
|
||||||
items.map(function(item) {
|
items.forEach(item => window.NativeShell.downloadFile(item));
|
||||||
window.NativeShell.downloadFile(item);
|
|
||||||
});
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue