mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-28 14:54:38 +02:00
Book duration shown on match page compares minutes #1803
This commit is contained in:
parent
0cbcfbd273
commit
b42edfe7a7
2 changed files with 9 additions and 9 deletions
|
@ -70,14 +70,14 @@ export default {
|
|||
return (this.book.duration || 0) * 60
|
||||
},
|
||||
bookDurationComparison() {
|
||||
if (!this.bookDuration || !this.currentBookDuration) return ''
|
||||
let differenceInSeconds = this.currentBookDuration - this.bookDuration
|
||||
// Only show seconds on difference if difference is less than an hour
|
||||
if (differenceInSeconds < 0) {
|
||||
differenceInSeconds = Math.abs(differenceInSeconds)
|
||||
return `(${this.$elapsedPrettyExtended(differenceInSeconds, false, differenceInSeconds < 3600)} shorter)`
|
||||
} else if (differenceInSeconds > 0) {
|
||||
return `(${this.$elapsedPrettyExtended(differenceInSeconds, false, differenceInSeconds < 3600)} longer)`
|
||||
if (!this.book.duration || !this.currentBookDuration) return ''
|
||||
const currentBookDurationMinutes = Math.floor(this.currentBookDuration / 60)
|
||||
let differenceInMinutes = currentBookDurationMinutes - this.book.duration
|
||||
if (differenceInMinutes < 0) {
|
||||
differenceInMinutes = Math.abs(differenceInMinutes)
|
||||
return `(${this.$elapsedPrettyExtended(differenceInMinutes * 60, false, false)} shorter)`
|
||||
} else if (differenceInMinutes > 0) {
|
||||
return `(${this.$elapsedPrettyExtended(differenceInMinutes * 60, false, false)} longer)`
|
||||
}
|
||||
return '(exact match)'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue