Skip to content

Commit 8de1026

Browse files
authored
Add Creative Commons License to Description of Videos (#6614)
* feat: add creative commons license to description * fix: change the cc license position to video description * fix: add license only for the full description
1 parent 47d4103 commit 8de1026

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/renderer/components/WatchVideoDescription/WatchVideoDescription.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@
4343
max-block-size: 4lh;
4444
overflow: hidden;
4545
}
46+
47+
.license {
48+
margin-block: 1em;
49+
}

src/renderer/components/WatchVideoDescription/WatchVideoDescription.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
@timestamp-event="onTimestamp"
2323
@click.native="expandDescriptionWithClick"
2424
/>
25+
<span
26+
v-if="license && showFullDescription"
27+
class="license"
28+
>
29+
{{ license }}
30+
</span>
2531
<span
2632
v-if="showControls && showFullDescription"
2733
class="descriptionStatus"
@@ -51,6 +57,10 @@ const props = defineProps({
5157
descriptionHtml: {
5258
type: String,
5359
default: ''
60+
},
61+
license: {
62+
type: String,
63+
default: null,
5464
}
5565
})
5666

src/renderer/views/Watch/Watch.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ export default defineComponent({
413413
// extract localised title first and fall back to the not localised one
414414
this.videoTitle = result.primary_info?.title.text ?? result.basic_info.title
415415
this.videoViewCount = result.basic_info.view_count ?? (result.primary_info.view_count ? extractNumberFromString(result.primary_info.view_count.text) : null)
416+
this.license = result.secondary_info.metadata.rows.find(element => element.title.text === 'License')?.contents[0].text
416417

417418
this.channelId = result.basic_info.channel_id ?? result.secondary_info.owner?.author.id
418419
this.channelName = result.basic_info.author ?? result.secondary_info.owner?.author.name

src/renderer/views/Watch/Watch.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
v-if="!isLoading && !hideVideoDescription"
169169
:description="videoDescription"
170170
:description-html="videoDescriptionHtml"
171+
:license="license"
171172
class="watchVideo"
172173
:class="{ theatreWatchVideo: useTheatreMode }"
173174
@timestamp-event="changeTimestamp"

0 commit comments

Comments
 (0)