mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-27 03:31:46 +00:00
Apply suggestions from code review
Thanks for all the tweaks @advplyr! Co-authored-by: advplyr <67830747+advplyr@users.noreply.github.com>
This commit is contained in:
parent
f64c74519b
commit
adba22cbd6
3 changed files with 3 additions and 34 deletions
|
|
@ -51,11 +51,8 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
coverAspectRatio() {
|
||||
return this.$store.getters['getServerSetting']('coverAspectRatio')
|
||||
},
|
||||
bookCoverAspectRatio() {
|
||||
return this.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE ? 1 : 1.6
|
||||
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
||||
},
|
||||
bookCoverWidth() {
|
||||
return 70
|
||||
|
|
@ -64,25 +61,6 @@ export default {
|
|||
if (!this.listeningStats) return []
|
||||
return this.listeningStats.sort(function(a, b) {return b.latest.lastUpdate - a.latest.lastUpdate})
|
||||
},
|
||||
userMediaProgress() {
|
||||
return this.user.mediaProgress || []
|
||||
},
|
||||
userItemsFinished() {
|
||||
if (!this.listeningStats) return []
|
||||
return this.listeningStats.itemsRead
|
||||
},
|
||||
mostRecentListeningSessions() {
|
||||
if (!this.listeningStats) return []
|
||||
return this.listeningStats.recentSessions || []
|
||||
},
|
||||
totalMinutesListening() {
|
||||
if (!this.listeningStats) return 0
|
||||
return Math.round(this.listeningStats.totalTime / 60)
|
||||
},
|
||||
totalDaysListened() {
|
||||
if (!this.listeningStats) return 0
|
||||
return Object.values(this.listeningStats.days).length
|
||||
},
|
||||
usersOnline() {
|
||||
var usermap = {}
|
||||
this.$store.state.users.users.forEach((u) => (usermap[u.id] = { online: true, session: u.session }))
|
||||
|
|
@ -109,14 +87,6 @@ export default {
|
|||
}
|
||||
this.listeningStats = listeningStats
|
||||
},
|
||||
async getLibraryItem(user) {
|
||||
user.libraryItem = await this.$axios
|
||||
.$get(`/api/items/${id}`)
|
||||
.catch((error) => {
|
||||
console.error('Failed', error)
|
||||
return false
|
||||
})
|
||||
},
|
||||
changeSharingSetting() {
|
||||
this.$store.dispatch('user/updateUserSettings', { shareListeningActivity: !this.isSharingActivity })
|
||||
this.init()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue