mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
BookFinder formatting update
This commit is contained in:
parent
0282a0521b
commit
b580a23e7e
@ -354,8 +354,8 @@ class BookFinder {
|
|||||||
|
|
||||||
if (books.length) {
|
if (books.length) {
|
||||||
const resultsHaveDuration = provider.startsWith('audible')
|
const resultsHaveDuration = provider.startsWith('audible')
|
||||||
if (resultsHaveDuration && libraryItem && libraryItem.media?.duration) {
|
if (resultsHaveDuration && libraryItem?.media?.duration) {
|
||||||
const libraryItemDurationMinutes = libraryItem.media.duration/60
|
const libraryItemDurationMinutes = libraryItem.media.duration / 60
|
||||||
// If provider results have duration, sort by ascendinge duration difference from libraryItem
|
// If provider results have duration, sort by ascendinge duration difference from libraryItem
|
||||||
books.sort((a, b) => {
|
books.sort((a, b) => {
|
||||||
const aDuration = a.duration || Number.POSITIVE_INFINITY
|
const aDuration = a.duration || Number.POSITIVE_INFINITY
|
||||||
@ -472,7 +472,7 @@ function cleanTitleForCompares(title) {
|
|||||||
function cleanAuthorForCompares(author) {
|
function cleanAuthorForCompares(author) {
|
||||||
if (!author) return ''
|
if (!author) return ''
|
||||||
author = stripRedundantSpaces(author)
|
author = stripRedundantSpaces(author)
|
||||||
|
|
||||||
let cleanAuthor = replaceAccentedChars(author).toLowerCase()
|
let cleanAuthor = replaceAccentedChars(author).toLowerCase()
|
||||||
// separate initials
|
// separate initials
|
||||||
cleanAuthor = cleanAuthor.replace(/([a-z])\.([a-z])/g, '$1. $2')
|
cleanAuthor = cleanAuthor.replace(/([a-z])\.([a-z])/g, '$1. $2')
|
||||||
|
Loading…
Reference in New Issue
Block a user