mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-08 00:08:14 +01:00
Book duration shown on match page compares minutes #1803
This commit is contained in:
parent
0cbcfbd273
commit
b42edfe7a7
@ -70,14 +70,14 @@ export default {
|
|||||||
return (this.book.duration || 0) * 60
|
return (this.book.duration || 0) * 60
|
||||||
},
|
},
|
||||||
bookDurationComparison() {
|
bookDurationComparison() {
|
||||||
if (!this.bookDuration || !this.currentBookDuration) return ''
|
if (!this.book.duration || !this.currentBookDuration) return ''
|
||||||
let differenceInSeconds = this.currentBookDuration - this.bookDuration
|
const currentBookDurationMinutes = Math.floor(this.currentBookDuration / 60)
|
||||||
// Only show seconds on difference if difference is less than an hour
|
let differenceInMinutes = currentBookDurationMinutes - this.book.duration
|
||||||
if (differenceInSeconds < 0) {
|
if (differenceInMinutes < 0) {
|
||||||
differenceInSeconds = Math.abs(differenceInSeconds)
|
differenceInMinutes = Math.abs(differenceInMinutes)
|
||||||
return `(${this.$elapsedPrettyExtended(differenceInSeconds, false, differenceInSeconds < 3600)} shorter)`
|
return `(${this.$elapsedPrettyExtended(differenceInMinutes * 60, false, false)} shorter)`
|
||||||
} else if (differenceInSeconds > 0) {
|
} else if (differenceInMinutes > 0) {
|
||||||
return `(${this.$elapsedPrettyExtended(differenceInSeconds, false, differenceInSeconds < 3600)} longer)`
|
return `(${this.$elapsedPrettyExtended(differenceInMinutes * 60, false, false)} longer)`
|
||||||
}
|
}
|
||||||
return '(exact match)'
|
return '(exact match)'
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ export default {
|
|||||||
value: 'json'
|
value: 'json'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '.abs',
|
text: '.abs (deprecated)',
|
||||||
value: 'abs'
|
value: 'abs'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user