From 8de0c5fef0327eb805b5bbca646f3b8ef5ab6c77 Mon Sep 17 00:00:00 2001 From: Preston Date: Fri, 25 Sep 2020 10:14:49 -0400 Subject: [PATCH] Show different message if Upcoming text isn't available. Assume premiere date has passed --- src/renderer/views/Watch/Watch.js | 12 +++++++++--- src/renderer/views/Watch/Watch.vue | 7 +++++++ static/locales/en-US.yaml | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index f60fc2ef..1e689705 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -281,8 +281,14 @@ export default Vue.extend({ this.activeSourceList = this.videoSourceList } } else if (this.isUpcoming) { - const upcomingTimestamp = new Date(result.videoDetails.liveBroadcastDetails.startTimestamp) - this.upcomingTimestamp = upcomingTimestamp.toLocaleString() + const startTimestamp = result.videoDetails.liveBroadcastDetails.startTimestamp + + if (typeof startTimestamp !== 'undefined') { + const upcomingTimestamp = new Date(result.videoDetails.liveBroadcastDetails.startTimestamp) + this.upcomingTimestamp = upcomingTimestamp.toLocaleString() + } else { + this.upcomingTimestamp = null + } } else { this.videoLengthSeconds = parseInt(result.videoDetails.lengthSeconds) this.videoSourceList = result.player_response.streamingData.formats.reverse() @@ -672,7 +678,7 @@ export default Vue.extend({ handleRouteChange: function () { clearTimeout(this.playNextTimeout) - if (this.rememberHistory && !this.isLoading && !this.isLive) { + if (this.rememberHistory && !this.isUpcoming && !this.isLoading && !this.isLive) { const player = this.$refs.videoPlayer.player if (player !== null && this.saveWatchedProgress) { diff --git a/src/renderer/views/Watch/Watch.vue b/src/renderer/views/Watch/Watch.vue index a98c09e1..ee695f23 100644 --- a/src/renderer/views/Watch/Watch.vue +++ b/src/renderer/views/Watch/Watch.vue @@ -43,12 +43,19 @@ class="premiereIcon" />

Premieres on:
{{ upcomingTimestamp }}

+

+ {{ $t("Video.Starting soon, please refresh the page to check again") }} +

diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index afc591ef..f2ba7ec9 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -377,6 +377,7 @@ Video: Watching: Watching Watched: Watched Autoplay: Autoplay + Starting soon, please refresh the page to check again: Starting soon, please refresh the page to check again # As in a Live Video Live: Live Live Now: Live Now