mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Sort playback media sources alphabetically
Sorts the map of media sources received by the server alphabetically ignoring capitilisation.
This commit is contained in:
parent
a48e78edac
commit
5ad1c57b52
1 changed files with 11 additions and 0 deletions
|
@ -146,6 +146,17 @@ define(['loading', 'appRouter', 'layoutManager', 'connectionManager', 'userSetti
|
|||
page.querySelector('.trackSelections').classList.remove('hide');
|
||||
select.setLabel(globalize.translate('LabelVersion'));
|
||||
var currentValue = select.value;
|
||||
mediaSources.sort(function(a, b) {
|
||||
var nameA = a.Name.toUpperCase();
|
||||
var nameB = b.Name.toUpperCase();
|
||||
if(nameA < nameB) {
|
||||
return -1;
|
||||
}
|
||||
if(nameA > nameB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
var selectedId = mediaSources[0].Id;
|
||||
select.innerHTML = mediaSources.map(function (v) {
|
||||
var selected = v.Id === selectedId ? ' selected' : '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue