mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-04-18 21:19:44 +00:00
fix: safeguard against undefined ServerSettings during db migration
This commit is contained in:
parent
c8a34ad60e
commit
b0280f614b
1 changed files with 1 additions and 1 deletions
|
|
@ -171,7 +171,7 @@ module.exports.cleanStringForSearch = (str) => {
|
||||||
|
|
||||||
const getTitleParts = (title) => {
|
const getTitleParts = (title) => {
|
||||||
if (!title) return ['', null]
|
if (!title) return ['', null]
|
||||||
const prefixesToIgnore = global.ServerSettings.sortingPrefixes || []
|
const prefixesToIgnore = global.ServerSettings?.sortingPrefixes || []
|
||||||
for (const prefix of prefixesToIgnore) {
|
for (const prefix of prefixesToIgnore) {
|
||||||
// e.g. for prefix "the". If title is "The Book" return "Book, The"
|
// e.g. for prefix "the". If title is "The Book" return "Book, The"
|
||||||
if (title.toLowerCase().startsWith(`${prefix} `)) {
|
if (title.toLowerCase().startsWith(`${prefix} `)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue