Change to only consider currently live broadcasts as livestreams. (#728)

* Remove isLiveContent, so only now live is true

* Change Published on to Streamed on when applicable
This commit is contained in:
Duane Jaspers 2020-10-31 15:57:51 +01:00 committed by GitHub
parent e7ce45b524
commit 3c8dfb84b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 2 deletions

View File

@ -63,6 +63,14 @@ export default Vue.extend({
type: Function,
required: true
},
isLive: {
type: Boolean,
required: false
},
isLiveContent: {
type: Boolean,
required: true
},
isUpcoming: {
type: Boolean,
required: true
@ -177,6 +185,16 @@ export default Vue.extend({
const dateSplit = date.toDateString().split(' ')
const localeDateString = `Video.Published.${dateSplit[1]}`
return `${this.$t(localeDateString)} ${dateSplit[2]}, ${dateSplit[3]}`
},
publishedString() {
if (this.isLiveContent && this.isLive) {
return this.$t('Video.Started streaming on')
} else if (this.isLiveContent && !this.isLive) {
return this.$t('Video.Streamed on')
} else {
return this.$t('Video.Published on')
}
}
},
methods: {

View File

@ -39,7 +39,7 @@
</div>
<div>
<div class="datePublished">
{{ $t("Video.Published on") }} {{ dateString }}
{{ publishedString }} {{ dateString }}
</div>
<div class="viewCount">
{{ parsedViewCount }}

View File

@ -44,6 +44,7 @@ export default Vue.extend({
showYouTubeNoCookieEmbed: false,
hidePlayer: false,
isLive: false,
isLiveContent: false,
isUpcoming: false,
upcomingTimestamp: null,
activeFormat: 'legacy',
@ -234,7 +235,8 @@ export default Vue.extend({
this.videoLikeCount = result.videoDetails.likes
this.videoDislikeCount = result.videoDetails.dislikes
}
this.isLive = result.player_response.videoDetails.isLiveContent || result.player_response.videoDetails.isLive
this.isLive = result.player_response.videoDetails.isLive
this.isLiveContent = result.player_response.videoDetails.isLiveContent
this.isUpcoming = result.player_response.videoDetails.isUpcoming ? result.player_response.videoDetails.isUpcoming : false
if (!this.isLive && !this.isUpcoming) {

View File

@ -74,6 +74,8 @@
:dislike-count="videoDislikeCount"
:view-count="videoViewCount"
:get-timestamp="getTimestamp"
:is-live-content="isLiveContent"
:is-live="isLive"
:is-upcoming="isUpcoming"
:download-links="downloadLinks"
class="watchVideo"

View File

@ -463,6 +463,8 @@ Video:
Ago: Ago
Upcoming: Premieres on
Published on: Published on
Streamed on: Streamed on
Started streaming on: Started streaming on
# $ is replaced with the number and % with the unit (days, hours, minutes...)
Publicationtemplate: $ % ago
#& Videos