From 6a4d3a55b128bb8402698d7805ce9374d142eae8 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sat, 5 Mar 2022 10:10:42 -0600 Subject: [PATCH] Fix:User last activity --- client/components/tables/UsersTable.vue | 6 ++++-- client/pages/config/users/_id.vue | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/components/tables/UsersTable.vue b/client/components/tables/UsersTable.vue index 86a7c3a0..99e5c302 100644 --- a/client/components/tables/UsersTable.vue +++ b/client/components/tables/UsersTable.vue @@ -87,9 +87,11 @@ export default { }, methods: { getLastRead(audiobooks) { - var abs = Object.values(audiobooks) + var abs = Object.values(audiobooks).filter((ab) => { + return ab.progress > 0 + }) if (abs.length) { - abs = abs.sort((a, b) => a.lastUpdate - b.lastUpdate) + abs = abs.sort((a, b) => b.lastUpdate - a.lastUpdate) // Book object is attached on request if (abs[0].book) return abs[0].book.title return abs[0].audiobookTitle ? abs[0].audiobookTitle : null diff --git a/client/pages/config/users/_id.vue b/client/pages/config/users/_id.vue index 3454210b..c4726ca5 100644 --- a/client/pages/config/users/_id.vue +++ b/client/pages/config/users/_id.vue @@ -15,18 +15,18 @@
-

Listening Stats (web app only)

+

Listening Stats (experimental)

Total Time Listened:  {{ listeningTimePretty }}

-

+

Time Listened Today:  {{ $elapsedPrettyExtended(timeListenedToday) }}

-

Last Listening Session (web app only)

+

Last Listening Session

{{ latestSession.audiobookTitle }} {{ $dateDistanceFromNow(latestSession.lastUpdate) }} for {{ $elapsedPrettyExtended(this.latestSession.timeListening) }}