Skip to content

Commit 66888bf

Browse files
committed
Add badge to watch page indicating whether video is unlisted (#1475)
1 parent 738c67e commit 66888bf

File tree

6 files changed

+26
-0
lines changed

6 files changed

+26
-0
lines changed

src/renderer/components/watch-video-info/watch-video-info.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ export default defineComponent({
106106
inUserPlaylist: {
107107
type: Boolean,
108108
required: true
109+
},
110+
isUnlisted: {
111+
type: Boolean,
112+
required: false
109113
}
110114
},
111115
emits: ['change-format', 'pause-player', 'set-info-area-sticky', 'scroll-to-info-area'],

src/renderer/components/watch-video-info/watch-video-info.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@
2222
gap: 10px;
2323
}
2424

25+
.unlistedBadge {
26+
background-color: var(--secondary-card-bg-color);
27+
border-radius: 5px;
28+
display: inline;
29+
padding-inline: 5px;
30+
white-space: nowrap;
31+
font-size: 0.8rem;
32+
line-height: 0.5rem;
33+
font-weight: 500;
34+
}
35+
2536
.videoButtons {
2637
.profileRow {
2738
display: flex;

src/renderer/components/watch-video-info/watch-video-info.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
>
77
{{ title }}
88
</h1>
9+
<div
10+
v-if="isUnlisted"
11+
class="unlistedBadge"
12+
>
13+
{{ $t('Video.Unlisted') }}
14+
</div>
915
</div>
1016
<div class="videoMetrics">
1117
<div class="datePublishedAndViewCount">

src/renderer/views/Watch/Watch.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export default defineComponent({
7676
isLiveContent: false,
7777
isUpcoming: false,
7878
isPostLiveDvr: false,
79+
isUnlisted: false,
7980
upcomingTimestamp: null,
8081
upcomingTimeLeft: null,
8182
/** @type {'dash' | 'audio' | 'legacy'} */
@@ -439,6 +440,7 @@ export default defineComponent({
439440
this.isUpcoming = !!result.basic_info.is_upcoming
440441
this.isLiveContent = !!result.basic_info.is_live_content
441442
this.isPostLiveDvr = !!result.basic_info.is_post_live_dvr
443+
this.isUnlisted = !!result.basic_info.is_unlisted
442444

443445
const subCount = !result.secondary_info.owner.subscriber_count.isEmpty() ? parseLocalSubscriberCount(result.secondary_info.owner.subscriber_count.text) : NaN
444446

@@ -774,6 +776,7 @@ export default defineComponent({
774776
this.isLive = result.liveNow
775777
this.isFamilyFriendly = result.isFamilyFriendly
776778
this.isPostLiveDvr = !!result.isPostLiveDvr
779+
this.isUnlisted = !result.isListed
777780

778781
this.captions = result.captions.map(caption => {
779782
return {

src/renderer/views/Watch/Watch.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
<watch-video-info
118118
v-if="!isLoading"
119119
:id="videoId"
120+
:is-unlisted="isUnlisted"
120121
:title="videoTitle"
121122
:channel-id="channelId"
122123
:channel-name="channelName"

static/locales/en-US.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,7 @@ Video:
809809
Premieres on: Premieres on
810810
Premieres: Premieres
811811
Upcoming: Upcoming
812+
Unlisted: Unlisted
812813
Live: Live
813814
Live Now: Live Now
814815
Live Chat: Live Chat

0 commit comments

Comments
 (0)