mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Added number check to sorting and parseInt radix
Introduced changes suggested by thornbill.
This commit is contained in:
parent
c8858b10f6
commit
746a6231fa
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue