Skip to content

Add Unlisted badge on watch page for unlisted videos #5856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/renderer/components/watch-video-info/watch-video-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ export default defineComponent({
inUserPlaylist: {
type: Boolean,
required: true
},
isUnlisted: {
type: Boolean,
required: false
}
},
emits: ['change-format', 'pause-player', 'set-info-area-sticky', 'scroll-to-info-area'],
Expand Down
11 changes: 11 additions & 0 deletions src/renderer/components/watch-video-info/watch-video-info.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@
gap: 10px;
}

.unlistedBadge {
background-color: var(--secondary-card-bg-color);
border-radius: 5px;
display: inline;
padding-inline: 5px;
white-space: nowrap;
font-size: 0.8rem;
line-height: 0.5rem;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we want to use rem as unit (for other devs)

font-weight: 500;
}

.videoButtons {
.profileRow {
display: flex;
Expand Down
6 changes: 6 additions & 0 deletions src/renderer/components/watch-video-info/watch-video-info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
>
{{ title }}
</h1>
<div
v-if="isUnlisted"
class="unlistedBadge"
>
{{ $t('Video.Unlisted') }}
</div>
</div>
<div class="videoMetrics">
<div class="datePublishedAndViewCount">
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export default defineComponent({
isLiveContent: false,
isUpcoming: false,
isPostLiveDvr: false,
isUnlisted: false,
upcomingTimestamp: null,
upcomingTimeLeft: null,
/** @type {'dash' | 'audio' | 'legacy'} */
Expand Down Expand Up @@ -439,6 +440,7 @@ export default defineComponent({
this.isUpcoming = !!result.basic_info.is_upcoming
this.isLiveContent = !!result.basic_info.is_live_content
this.isPostLiveDvr = !!result.basic_info.is_post_live_dvr
this.isUnlisted = !!result.basic_info.is_unlisted

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

Expand Down Expand Up @@ -774,6 +776,7 @@ export default defineComponent({
this.isLive = result.liveNow
this.isFamilyFriendly = result.isFamilyFriendly
this.isPostLiveDvr = !!result.isPostLiveDvr
this.isUnlisted = !result.isListed

this.captions = result.captions.map(caption => {
return {
Expand Down
1 change: 1 addition & 0 deletions src/renderer/views/Watch/Watch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<watch-video-info
v-if="!isLoading"
:id="videoId"
:is-unlisted="isUnlisted"
:title="videoTitle"
:channel-id="channelId"
:channel-name="channelName"
Expand Down
1 change: 1 addition & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ Video:
Premieres on: Premieres on
Premieres: Premieres
Upcoming: Upcoming
Unlisted: Unlisted
Live: Live
Live Now: Live Now
Live Chat: Live Chat
Expand Down