mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Fix relevance sorting when name/alias contains leading spaces (#4895)
This commit is contained in:
parent
2ca53714a6
commit
e4267a0d83
1 changed files with 2 additions and 2 deletions
|
|
@ -89,12 +89,12 @@ export function sortByRelevance<T extends ISortable>(
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWords(o: T) {
|
function getWords(o: T) {
|
||||||
return getName(o).toLowerCase().split(" ");
|
return getName(o).trim().toLowerCase().split(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAliasWords(tag: T) {
|
function getAliasWords(tag: T) {
|
||||||
const aliases = getObjectAliases(tag);
|
const aliases = getObjectAliases(tag);
|
||||||
return aliases.map((a) => a.split(" ")).flat();
|
return aliases.map((a) => a.trim().split(" ")).flat();
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWordIndex(o: T) {
|
function getWordIndex(o: T) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue