From b6c7ef1d992f351b2c4d0986f79d2813fafae618 Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 4 Jan 2022 14:48:01 -0700 Subject: [PATCH] Using video path as alternate title on video player. Showing 'No Description' when no description is available. --- app/src/components/VideoPlayer.js | 4 ++-- modules/videos/common.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/components/VideoPlayer.js b/app/src/components/VideoPlayer.js index 0c2345b0..2874c056 100644 --- a/app/src/components/VideoPlayer.js +++ b/app/src/components/VideoPlayer.js @@ -70,7 +70,7 @@ function VideoPage(props) { let descriptionPane = { menuItem: 'Description', render: () =>
-                {description}
+                {description || 'No description'}
             
}; @@ -120,7 +120,7 @@ function VideoPage(props) { -

{video.title}

+

{video.title || video.video_path}

{video.upload_date &&

{uploadDate(video.upload_date)}

}

{channel && diff --git a/modules/videos/common.py b/modules/videos/common.py index ef34c144..0f4ba034 100644 --- a/modules/videos/common.py +++ b/modules/videos/common.py @@ -461,8 +461,7 @@ async def get_bulk_video_info_json(video_ids: List[int]): video.duration = get_video_duration(video.video_path.path) if not video.title: # Use the video path name without the extension. - video_path = video.video_path.path.with_suffix('') - video.title = video_path.name + video.title = video.video_path.path.with_suffix('').name # Unescape any HTML entities. video.title = html.unescape(video.title)