[Enhancement] Simple ratings from audible.com

This commit is contained in:
danny.rich 2025-11-03 13:46:51 -05:00
parent 0c7b738b7c
commit 831d50320c
13 changed files with 202 additions and 3 deletions

View file

@ -349,6 +349,13 @@ export default {
if (this.mediaMetadata.publishedYear) return this.$getString('LabelPublishedDate', [this.mediaMetadata.publishedYear])
return '\u00A0'
}
if (this.orderBy === 'media.metadata.rating') {
if (this.mediaMetadata.rating) {
const ratingValue = typeof this.mediaMetadata.rating === 'object' && this.mediaMetadata.rating.average ? this.mediaMetadata.rating.average : Number(this.mediaMetadata.rating)
if (!isNaN(ratingValue) && ratingValue > 0) return `Rating: ${ratingValue.toFixed(1)}`
}
return '\u00A0'
}
if (this.orderBy === 'progress') {
if (!this.userProgressLastUpdated) return '\u00A0'
return this.$getString('LabelLastProgressDate', [this.$formatDatetime(this.userProgressLastUpdated, this.dateFormat, this.timeFormat)])