Changed var to const

See https://github.com/jellyfin/jellyfin-web/pull/1237#issuecomment-713003436
This commit is contained in:
DesertCookie 2020-10-30 12:37:24 +01:00
parent 746a6231fa
commit 31af91f8c7

View File

@ -167,18 +167,18 @@ function renderTrackSelections(page, instance, item, forceReload) {
return; return;
} }
var mediaSources = item.MediaSources; const mediaSources = item.MediaSources;
var resolutionNames = []; const resolutionNames = [];
var sourceNames = []; const sourceNames = [];
mediaSources.forEach(function (v) { mediaSources.forEach(function (v) {
((v.Name.endsWith('p') || v.Name.endsWith('i'))) && !Number.isNaN(parseInt(v.Name, 10) ? resolutionNames.push(v) : sourceNames.push(v); ((v.Name.endsWith('p') || v.Name.endsWith('i'))) && !Number.isNaN(parseInt(v.Name, 10) ? resolutionNames.push(v) : sourceNames.push(v);
}); });
resolutionNames.sort((a, b) => parseInt(b.Name, 10) - parseInt(a.Name, 10)); resolutionNames.sort((a, b) => parseInt(b.Name, 10) - parseInt(a.Name, 10));
sourceNames.sort(function(a, b) { sourceNames.sort(function(a, b) {
var nameA = a.Name.toUpperCase(); const nameA = a.Name.toUpperCase();
var nameB = b.Name.toUpperCase(); const nameB = b.Name.toUpperCase();
if (nameA < nameB) { if (nameA < nameB) {
return -1; return -1;
} else if (nameA > nameB) { } else if (nameA > nameB) {