mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-19 11:58:20 -07:00
Added number check to sorting and parseInt radix
Introduced changes suggested by thornbill.
This commit is contained in:
parent
c8858b10f6
commit
746a6231fa
@ -172,10 +172,10 @@ function renderTrackSelections(page, instance, item, forceReload) {
|
|||||||
var resolutionNames = [];
|
var resolutionNames = [];
|
||||||
var sourceNames = [];
|
var sourceNames = [];
|
||||||
mediaSources.forEach(function (v) {
|
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) {
|
sourceNames.sort(function(a, b) {
|
||||||
var nameA = a.Name.toUpperCase();
|
var nameA = a.Name.toUpperCase();
|
||||||
var nameB = b.Name.toUpperCase();
|
var nameB = b.Name.toUpperCase();
|
||||||
|
Loading…
Reference in New Issue
Block a user