Sort search input by sortTitle

pull/2941/head
Mark McDowall 6 years ago
parent 102b8afd66
commit a29b1259b5

@ -50,6 +50,7 @@ function createCleanSeriesSelector() {
alternateTitles: alternateTitles.map((alternateTitle) => { alternateTitles: alternateTitles.map((alternateTitle) => {
return { return {
title: alternateTitle.title, title: alternateTitle.title,
sortTitle: alternateTitle.sortTitle,
cleanTitle: jdu.replace(alternateTitle.title).toLowerCase() cleanTitle: jdu.replace(alternateTitle.title).toLowerCase()
}; };
}), }),
@ -58,10 +59,10 @@ function createCleanSeriesSelector() {
}) })
}; };
}).sort((a, b) => { }).sort((a, b) => {
if (a.cleanTitle < b.cleanTitle) { if (a.sortTitle < b.sortTitle) {
return -1; return -1;
} }
if (a.cleanTitle > b.cleanTitle) { if (a.sortTitle > b.sortTitle) {
return 1; return 1;
} }

Loading…
Cancel
Save