Update new library scanner for scanning in new books

This commit is contained in:
advplyr 2023-09-01 18:01:17 -05:00
parent 75276f5a44
commit 0ecfdab463
13 changed files with 694 additions and 35 deletions

View file

@ -147,10 +147,22 @@ const getTitleParts = (title) => {
return [title, null]
}
/**
* Remove sortingPrefixes from title
* @example "The Good Book" => "Good Book"
* @param {string} title
* @returns {string}
*/
module.exports.getTitleIgnorePrefix = (title) => {
return getTitleParts(title)[0]
}
/**
* Put sorting prefix at the end of title
* @example "The Good Book" => "Good Book, The"
* @param {string} title
* @returns {string}
*/
module.exports.getTitlePrefixAtEnd = (title) => {
let [sort, prefix] = getTitleParts(title)
return prefix ? `${sort}, ${prefix}` : title