citra-emu
/
citra-web
Archived
1
0
Fork 0

Filter out articles in titles when sorting

This commit is contained in:
James 2017-06-11 23:20:14 +10:00
parent 0e6d22ef6f
commit f75ff8525f
1 changed files with 10 additions and 1 deletions

View File

@ -124,7 +124,16 @@ function processGame(game) {
model.testcase_date = recent.date; model.testcase_date = recent.date;
} }
let section_id = `${model.title[0]}`.toLowerCase(); const toTrim = ["the", "a", "an"];
let trimmedTitle = model.title.toLowerCase();
toTrim.forEach(trim => {
if (trimmedTitle.startsWith(trim)) {
trimmedTitle = trimmedTitle.substr(trim.length + 1);
}
});
let section_id = `${trimmedTitle[0]}`;
if (!section_id.match(/[a-z]+/)) { if (!section_id.match(/[a-z]+/)) {
section_id = "#"; section_id = "#";
} }