added logic to hide playlist views (#1916)

This commit is contained in:
HaydenB 2022-02-03 16:11:29 -07:00 committed by GitHub
parent a6538727b6
commit 9196457495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -47,6 +47,10 @@ export default Vue.extend({
return this.$store.getters.getThumbnailPreference return this.$store.getters.getThumbnailPreference
}, },
hideViews: function () {
return this.$store.getters.getHideVideoViews
},
shareHeaders: function () { shareHeaders: function () {
return [ return [
this.$t('Playlist.Share Playlist.Copy YouTube Link'), this.$t('Playlist.Share Playlist.Copy YouTube Link'),
@ -83,7 +87,7 @@ export default Vue.extend({
// Causes errors if not put inside of a check // Causes errors if not put inside of a check
if (typeof (this.data.viewCount) !== 'undefined') { if (typeof (this.data.viewCount) !== 'undefined') {
this.viewCount = this.data.viewCount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') this.viewCount = this.hideViews ? null : this.data.viewCount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')
} }
if (typeof (this.data.videoCount) !== 'undefined') { if (typeof (this.data.videoCount) !== 'undefined') {

View File

@ -12,7 +12,7 @@
{{ title }} {{ title }}
</h2> </h2>
<p> <p>
{{ videoCount }} {{ $t("Playlist.Videos") }} - {{ viewCount }} {{ $t("Playlist.Views") }} - {{ videoCount }} {{ $t("Playlist.Videos") }} - <span v-if="!hideViews">{{ viewCount }} {{ $t("Playlist.Views") }} -</span>
<span v-if="infoSource !== 'local'"> <span v-if="infoSource !== 'local'">
{{ $t("Playlist.Last Updated On") }} {{ $t("Playlist.Last Updated On") }}
</span> </span>