mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-31 23:20:05 +02:00
Update new library scanner for scanning in new books
This commit is contained in:
parent
75276f5a44
commit
0ecfdab463
13 changed files with 694 additions and 35 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue