From 124b9d9ea5c801a8e5ff4fa744958f93200f615e Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 30 Jul 2025 17:31:33 +0530 Subject: [PATCH] fix: video statistics scroll --- frontend/src/components/Modals/VideoStatistics.vue | 12 +++++++----- frontend/src/utils/index.js | 9 ++------- .../lms_video_watch_duration.json | 5 ++++- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/Modals/VideoStatistics.vue b/frontend/src/components/Modals/VideoStatistics.vue index 42c69d73..9b72d96b 100644 --- a/frontend/src/components/Modals/VideoStatistics.vue +++ b/frontend/src/components/Modals/VideoStatistics.vue @@ -23,7 +23,9 @@
-
+
{{ __('Member') }} @@ -59,7 +61,7 @@
- {{ convertToMinutes(row.watch_time) }} + {{ formatTimestamp(row.watch_time) }}
@@ -69,7 +71,7 @@ @@ -97,7 +99,7 @@ import { TabButtons, } from 'frappe-ui' import { computed, ref, watch } from 'vue' -import { enablePlyr, convertToMinutes } from '@/utils' +import { enablePlyr, formatTimestamp } from '@/utils' import VideoBlock from '@/components/VideoBlock.vue' const show = defineModel() @@ -185,7 +187,7 @@ const averageWatchTime = computed(() => { totalWatchTime += parseFloat(item.watch_time) }) - return convertToMinutes(totalWatchTime / currentTabData.value.length) + return formatTimestamp(totalWatchTime / currentTabData.value.length) }) const currentTabData = computed(() => { diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index d9b89681..157efe30 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -663,13 +663,8 @@ export const updateMetaInfo = (type, route, meta) => { export const formatTimestamp = (seconds) => { const date = new Date(seconds * 1000) + const hours = String(date.getUTCHours()).padStart(2, '0') const minutes = String(date.getUTCMinutes()).padStart(2, '0') const secs = String(date.getUTCSeconds()).padStart(2, '0') - return `${minutes}:${secs}` -} - -export const convertToMinutes = (seconds) => { - const minutes = Math.floor(seconds / 60) - const remainingSeconds = Math.round(seconds % 60) - return `${minutes}:${remainingSeconds.toString().padStart(2, '0')}` + return `${hours}:${minutes}:${secs}` } diff --git a/lms/lms/doctype/lms_video_watch_duration/lms_video_watch_duration.json b/lms/lms/doctype/lms_video_watch_duration/lms_video_watch_duration.json index 23ec7aa6..22b54db0 100644 --- a/lms/lms/doctype/lms_video_watch_duration/lms_video_watch_duration.json +++ b/lms/lms/doctype/lms_video_watch_duration/lms_video_watch_duration.json @@ -23,6 +23,7 @@ "fieldname": "lesson", "fieldtype": "Link", "in_list_view": 1, + "in_standard_filter": 1, "label": "Lesson", "options": "Course Lesson", "reqd": 1 @@ -39,6 +40,7 @@ "fetch_from": "lesson.course", "fieldname": "course", "fieldtype": "Link", + "in_standard_filter": 1, "label": "Course", "options": "LMS Course", "read_only": 1 @@ -51,6 +53,7 @@ "fieldname": "member", "fieldtype": "Link", "in_list_view": 1, + "in_standard_filter": 1, "label": "Member", "options": "User", "reqd": 1 @@ -99,7 +102,7 @@ "grid_page_length": 50, "index_web_pages_for_search": 1, "links": [], - "modified": "2025-06-30 16:57:10.561660", + "modified": "2025-07-30 14:38:52.555010", "modified_by": "sayali@frappe.io", "module": "LMS", "name": "LMS Video Watch Duration",