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(() => {
|
||||
const promises = itemIds.map(itemId => {
|
||||
apiClient.deleteItem(itemId);
|
||||
});
|
||||
const promises = itemIds.map(itemId => apiClient.deleteItem(itemId));
|
||||
|
||||
Promise.all(promises).then(resolve, () => {
|
||||
alertText(globalize.translate('ErrorDeletingItem')).then(reject, reject);
|
||||
|
|
|
@ -283,9 +283,9 @@ function getAudioMaxValues(deviceProfile) {
|
|||
let maxAudioBitDepth = null;
|
||||
let maxAudioBitrate = null;
|
||||
|
||||
deviceProfile.CodecProfiles.map(function (codecProfile) {
|
||||
deviceProfile.CodecProfiles.forEach(codecProfile => {
|
||||
if (codecProfile.Type === 'Audio') {
|
||||
(codecProfile.Conditions || []).map(function (condition) {
|
||||
(codecProfile.Conditions || []).forEach(condition => {
|
||||
if (condition.Condition === 'LessThanEqual' && condition.Property === 'AudioBitDepth') {
|
||||
return maxAudioBitDepth = condition.Value;
|
||||
} else if (condition.Condition === 'LessThanEqual' && condition.Property === 'AudioSampleRate') {
|
||||
|
@ -334,7 +334,7 @@ function getAudioStreamUrlFromDeviceProfile(item, deviceProfile, maxBitrate, api
|
|||
|
||||
let directPlayContainers = '';
|
||||
|
||||
deviceProfile.DirectPlayProfiles.map(function (p) {
|
||||
deviceProfile.DirectPlayProfiles.forEach(p => {
|
||||
if (p.Type === 'Audio') {
|
||||
if (directPlayContainers) {
|
||||
directPlayContainers += ',' + p.Container;
|
||||
|
@ -360,7 +360,7 @@ function getStreamUrls(items, deviceProfile, maxBitrate, apiClient, startPositio
|
|||
|
||||
let audioDirectPlayContainers = '';
|
||||
|
||||
deviceProfile.DirectPlayProfiles.map(function (p) {
|
||||
deviceProfile.DirectPlayProfiles.forEach(p => {
|
||||
if (p.Type === 'Audio') {
|
||||
if (audioDirectPlayContainers) {
|
||||
audioDirectPlayContainers += ',' + p.Container;
|
||||
|
|
|
@ -86,7 +86,7 @@ function unsubscribeFromPlayerUpdates(instance) {
|
|||
function processUpdatedSessions(instance, sessions, apiClient) {
|
||||
const serverId = apiClient.serverId();
|
||||
|
||||
sessions.map(function (s) {
|
||||
sessions.forEach(s => {
|
||||
if (s.NowPlayingItem) {
|
||||
s.NowPlayingItem.ServerId = serverId;
|
||||
}
|
||||
|
|
|
@ -33,9 +33,7 @@ export default {
|
|||
*/
|
||||
downloadFiles(items) {
|
||||
if (window.NativeShell) {
|
||||
items.map(function(item) {
|
||||
window.NativeShell.downloadFile(item);
|
||||
});
|
||||
items.forEach(item => window.NativeShell.downloadFile(item));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue