Including video.view_count in minimum video. Displaying video.view_count before info_json view count in UI.

This commit is contained in:
Roland 2021-11-11 17:05:04 -07:00
parent 165979f80a
commit 75169462e3
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 5 additions and 5 deletions

View file

@ -11,8 +11,7 @@ const MEDIA_PATH = '/media';
function VideoPage(props) {
let video = props.video;
let channel = video.channel;
let {video, channel} = props;
let [deleteOpen, setDeleteOpen] = useState(false);
async function handleDeleteVideo(video_id) {
@ -37,10 +36,10 @@ function VideoPage(props) {
}
let description = 'No description available.';
let viewCount = null;
let viewCount = video.view_count;
if (video.info_json) {
description = video.info_json['description'];
viewCount = video.info_json['view_count'];
viewCount = viewCount || video.info_json['view_count'];
}
let [favorite, setFavorite] = React.useState(video.favorite);

View file

@ -26,7 +26,8 @@ REQUIRED_OPTIONS = ['name', 'directory']
MINIMUM_CHANNEL_KEYS = {'id', 'name', 'directory', 'url', 'video_count', 'link'}
MINIMUM_INFO_JSON_KEYS = {'description', 'view_count'}
MINIMUM_VIDEO_KEYS = {'id', 'title', 'upload_date', 'duration', 'channel', 'channel_id', 'favorite', 'size',
'poster_path', 'caption_path', 'video_path', 'info_json', 'channel', 'viewed', 'source_id'}
'poster_path', 'caption_path', 'video_path', 'info_json', 'channel', 'viewed', 'source_id',
'view_count'}
VIDEO_QUERY_LIMIT = 20
VIDEO_QUERY_MAX_LIMIT = 100
# These are the supported video formats. These are in order of their preference.