diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index 1b07aef332..64b4f2f777 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -172,10 +172,10 @@ function renderTrackSelections(page, instance, item, forceReload) { var resolutionNames = []; var sourceNames = []; mediaSources.forEach(function (v) { - (v.Name.endsWith('p') || v.Name.endsWith('i')) ? 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) - parseInt(a.Name)); + resolutionNames.sort((a, b) => parseInt(b.Name, 10) - parseInt(a.Name, 10)); sourceNames.sort(function(a, b) { var nameA = a.Name.toUpperCase(); var nameB = b.Name.toUpperCase();