aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/youtube/YoutubeBox.tsx
diff options
context:
space:
mode:
authorAbdullah Ahmed <abdullah_ahmed@brown.edu>2019-08-13 11:02:45 -0400
committerAbdullah Ahmed <abdullah_ahmed@brown.edu>2019-08-13 11:02:45 -0400
commit6c8b7a4e74068178b0f6ca9e491441bf982b4622 (patch)
treecc52f43409819694359d5fcd07f6f01cbd39dea1 /src/client/apis/youtube/YoutubeBox.tsx
parentb38e808dc7790cc8698824329ae63b3af210996c (diff)
parent9dd2a31b72e5e527e2dae3b68f856ab8da879e93 (diff)
Merge branch 'recommender_system' of https://github.com/browngraphicslab/Dash-Web into recommender_system
Diffstat (limited to 'src/client/apis/youtube/YoutubeBox.tsx')
-rw-r--r--src/client/apis/youtube/YoutubeBox.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/apis/youtube/YoutubeBox.tsx b/src/client/apis/youtube/YoutubeBox.tsx
index dc142802c..d73988bb8 100644
--- a/src/client/apis/youtube/YoutubeBox.tsx
+++ b/src/client/apis/youtube/YoutubeBox.tsx
@@ -57,7 +57,7 @@ export class YoutubeBox extends React.Component<FieldViewProps> {
if (awaitedBackUp) {
- let jsonList = await DocListCastAsync(awaitedBackUp!.json);
+ let jsonList = await DocListCastAsync(awaitedBackUp.json);
let jsonDetailList = await DocListCastAsync(awaitedDetails!.json);
if (jsonList!.length !== 0) {
@@ -76,8 +76,8 @@ export class YoutubeBox extends React.Component<FieldViewProps> {
let videoDescription = StrCast(snippet!.description);
let pusblishDate = (this.roundPublishTime(StrCast(snippet!.publishedAt)))!;
let channelTitle = StrCast(snippet!.channelTitle);
- let duration: string;
- let viewCount: string;
+ let duration: string = "";
+ let viewCount: string = "";
if (jsonDetailList!.length !== 0) {
let contentDetails = await Cast(jsonDetailList![index].contentDetails, Doc);
let statistics = await Cast(jsonDetailList![index].statistics, Doc);
@@ -85,7 +85,7 @@ export class YoutubeBox extends React.Component<FieldViewProps> {
viewCount = this.abbreviateViewCount(parseInt(StrCast(statistics!.viewCount)))!;
}
index = index + 1;
- let newTemplate: VideoTemplate = { videoId: id, videoTitle: videoTitle, thumbnailUrl: thumbnailUrl, publishDate: pusblishDate, channelTitle: channelTitle, videoDescription: videoDescription, duration: duration!, viewCount: viewCount! };
+ let newTemplate: VideoTemplate = { videoId: id, videoTitle: videoTitle, thumbnailUrl: thumbnailUrl, publishDate: pusblishDate, channelTitle: channelTitle, videoDescription: videoDescription, duration: duration, viewCount: viewCount };
runInAction(() => this.curVideoTemplates.push(newTemplate));
}
}