music: strip articles from extremely short names
Strip articles from names that are longer than 2-4 characters, compared the prior limit of 3-5. Resolves #440.
This commit is contained in:
parent
eb4adcc109
commit
7ba2b1bb41
1 changed files with 3 additions and 3 deletions
|
@ -183,9 +183,9 @@ private data class IntelligentKnownName(override val raw: String, override val s
|
||||||
// Strip any english articles like "the" or "an" from the start, as music
|
// Strip any english articles like "the" or "an" from the start, as music
|
||||||
// sorting should ignore such when possible.
|
// sorting should ignore such when possible.
|
||||||
when {
|
when {
|
||||||
length > 5 && startsWith("the ", ignoreCase = true) -> substring(4)
|
length > 4 && startsWith("the ", ignoreCase = true) -> substring(4)
|
||||||
length > 4 && startsWith("an ", ignoreCase = true) -> substring(3)
|
length > 3 && startsWith("an ", ignoreCase = true) -> substring(3)
|
||||||
length > 3 && startsWith("a ", ignoreCase = true) -> substring(2)
|
length > 2 && startsWith("a ", ignoreCase = true) -> substring(2)
|
||||||
else -> this
|
else -> this
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue