mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-06 00:16:02 +01:00
Add:Show audiobook duration and narrator in audible match results #886
This commit is contained in:
parent
605a6d8b25
commit
3d3571013f
@ -10,7 +10,9 @@
|
|||||||
<div class="flex-grow" />
|
<div class="flex-grow" />
|
||||||
<p>{{ book.publishedYear }}</p>
|
<p>{{ book.publishedYear }}</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-gray-300 text-sm">{{ book.author }}</p>
|
<p class="text-gray-300 text-sm">by {{ book.author }}</p>
|
||||||
|
<p v-if="book.narrator" class="text-gray-400 text-xs">Narrated by {{ book.narrator }}</p>
|
||||||
|
<p v-if="book.duration" class="text-gray-400 text-xs">Runtime: {{ $elapsedPrettyExtended(book.duration) }}</p>
|
||||||
<div v-if="book.series && book.series.length" class="flex py-1 -mx-1">
|
<div v-if="book.series && book.series.length" class="flex py-1 -mx-1">
|
||||||
<div v-for="(series, index) in book.series" :key="index" class="bg-white bg-opacity-10 rounded-full px-1 py-0.5 mx-1">
|
<div v-for="(series, index) in book.series" :key="index" class="bg-white bg-opacity-10 rounded-full px-1 py-0.5 mx-1">
|
||||||
<p class="leading-3 text-xs text-gray-400">
|
<p class="leading-3 text-xs text-gray-400">
|
||||||
|
@ -319,6 +319,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.searchResults = results || []
|
this.searchResults = results || []
|
||||||
|
console.log('Results', results)
|
||||||
this.isProcessing = false
|
this.isProcessing = false
|
||||||
this.hasSearched = true
|
this.hasSearched = true
|
||||||
},
|
},
|
||||||
|
@ -6,7 +6,7 @@ class Audible {
|
|||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
cleanResult(item) {
|
cleanResult(item) {
|
||||||
var { title, subtitle, asin, authors, narrators, publisherName, summary, releaseDate, image, genres, seriesPrimary, seriesSecondary, language } = item
|
var { title, subtitle, asin, authors, narrators, publisherName, summary, releaseDate, image, genres, seriesPrimary, seriesSecondary, language, runtimeLengthMin } = item
|
||||||
|
|
||||||
var series = []
|
var series = []
|
||||||
if (seriesPrimary) series.push(seriesPrimary)
|
if (seriesPrimary) series.push(seriesPrimary)
|
||||||
@ -28,7 +28,8 @@ class Audible {
|
|||||||
genres: genresFiltered.length > 0 ? genresFiltered.map(({ name }) => name).join(', ') : null,
|
genres: genresFiltered.length > 0 ? genresFiltered.map(({ name }) => name).join(', ') : null,
|
||||||
tags: tagsFiltered.length > 0 ? tagsFiltered.map(({ name }) => name).join(', ') : null,
|
tags: tagsFiltered.length > 0 ? tagsFiltered.map(({ name }) => name).join(', ') : null,
|
||||||
series: series != [] ? series.map(({ name, position }) => ({ series: name, volumeNumber: position })) : null,
|
series: series != [] ? series.map(({ name, position }) => ({ series: name, volumeNumber: position })) : null,
|
||||||
language: language ? language.charAt(0).toUpperCase() + language.slice(1) : null
|
language: language ? language.charAt(0).toUpperCase() + language.slice(1) : null,
|
||||||
|
duration: runtimeLengthMin && !isNaN(runtimeLengthMin) ? Number(runtimeLengthMin) : 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +78,6 @@ class Audible {
|
|||||||
return []
|
return []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return items ? items.map(item => this.cleanResult(item)) : []
|
return items ? items.map(item => this.cleanResult(item)) : []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user