mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-06-27 20:46:17 +02:00
Update new library scanner for scanning in new books
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user