mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-28 21:19:42 +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) => {
|
||||
if (!title) return ['', null]
|
||||
const prefixesToIgnore = global.ServerSettings.sortingPrefixes || []
|
||||
const prefixesToIgnore = global.ServerSettings?.sortingPrefixes || []
|
||||
for (const prefix of prefixesToIgnore) {
|
||||
// e.g. for prefix "the". If title is "The Book" return "Book, The"
|
||||
if (title.toLowerCase().startsWith(`${prefix} `)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue