Skip to content

Commit ab96588

Browse files
committed
Merge branch 'development' into custom-builds/tmp
* development: Translated using Weblate (Polish) ! Fix no comment detection (FreeTubeApp#5879) Fix wrong live stream playlist used for subscriptions (FreeTubeApp#5876) Translated using Weblate (Arabic) Run linter when PRs are made against RC branches
2 parents 6df21cd + 976727a commit ab96588

File tree

7 files changed

+109
-70
lines changed

7 files changed

+109
-70
lines changed

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Linter
66
# events but only for the master branch
77
on:
88
pull_request:
9-
branches: [ master, development ]
9+
branches: [ master, development, '**-RC' ]
1010

1111
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1212
jobs:

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

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ export default defineComponent({
3232
type: Boolean,
3333
required: true
3434
},
35-
forceState: {
36-
type: String,
37-
default: null,
38-
},
3935
isPostComments: {
4036
type: Boolean,
4137
default: false,
@@ -145,20 +141,6 @@ export default defineComponent({
145141
return this.$store.getters.getActiveProfile.subscriptions
146142
}
147143
},
148-
created: function () {
149-
// region No comment detection
150-
// For videos without any comment (comment disabled?)
151-
// e.g. https://youtu.be/8NBSwDEf8a8
152-
//
153-
// `comments_entry_point_header` is null probably when comment disabled
154-
if (this.forceState === 'noComment') {
155-
this.commentData = []
156-
this.nextPageToken = null
157-
this.isLoading = false
158-
this.showComments = true
159-
}
160-
// endregion No comment detection
161-
},
162144
methods: {
163145
onTimestamp: function (timestamp) {
164146
this.$emit('timestamp-event', timestamp)
@@ -255,6 +237,19 @@ export default defineComponent({
255237
this.isLoading = false
256238
this.showComments = true
257239
} catch (err) {
240+
// region No comment detection
241+
// No comment related info when video info requested earlier in parent component
242+
if (err.message.includes('Comments page did not have any content')) {
243+
// For videos without any comment (comment disabled?)
244+
// e.g. https://youtu.be/8NBSwDEf8a8
245+
this.commentData = []
246+
this.nextPageToken = null
247+
this.isLoading = false
248+
this.showComments = true
249+
return
250+
}
251+
// endregion No comment detection
252+
258253
console.error(err)
259254
const errorMessage = this.$t('Local API Error (Click to copy)')
260255
showToast(`${errorMessage}: ${err}`, 10000, () => {

src/renderer/helpers/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,9 +875,9 @@ export function getChannelPlaylistId(channelId, type, sortBy) {
875875
}
876876
case 'live':
877877
if (sortBy === 'popular') {
878-
return channelId.replace(/^UC/, 'UULV')
879-
} else {
880878
return channelId.replace(/^UC/, 'UUPV')
879+
} else {
880+
return channelId.replace(/^UC/, 'UULV')
881881
}
882882
case 'shorts':
883883
if (sortBy === 'popular') {

src/renderer/views/Watch/Watch.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ export default defineComponent({
116116
playNextTimeout: null,
117117
playNextCountDownIntervalId: null,
118118
infoAreaSticky: true,
119-
commentsEnabled: true,
120119

121120
onMountedRun: false,
122121

@@ -486,17 +485,6 @@ export default defineComponent({
486485
this.liveChat = null
487486
}
488487

489-
// region No comment detection
490-
// For videos without any comment (comment disabled?)
491-
// e.g. https://youtu.be/8NBSwDEf8a8
492-
//
493-
// `comments_entry_point_header` is null probably when comment disabled
494-
// e.g. https://youtu.be/8NBSwDEf8a8
495-
// However videos with comments enabled but have no comment
496-
// are different (which is not detected here)
497-
this.commentsEnabled = result.comments_entry_point_header != null
498-
// endregion No comment detection
499-
500488
if ((this.isLive || this.isPostLiveDvr) && !this.isUpcoming) {
501489
let useRemoteManifest = true
502490

src/renderer/views/Watch/Watch.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@
170170
:channel-thumbnail="channelThumbnail"
171171
:channel-name="channelName"
172172
:video-player-ready="videoPlayerLoaded"
173-
:force-state="commentsEnabled ? null : 'noComment'"
174173
@timestamp-event="changeTimestamp"
175174
/>
176175
</div>

0 commit comments

Comments
 (0)