Skip to content

Commit

Permalink
Merge branch 'development' into custom-builds/tmp
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
PikachuEXE committed Oct 16, 2024
2 parents 6df21cd + 976727a commit ab96588
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Linter
# events but only for the master branch
on:
pull_request:
branches: [ master, development ]
branches: [ master, development, '**-RC' ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ export default defineComponent({
type: Boolean,
required: true
},
forceState: {
type: String,
default: null,
},
isPostComments: {
type: Boolean,
default: false,
Expand Down Expand Up @@ -145,20 +141,6 @@ export default defineComponent({
return this.$store.getters.getActiveProfile.subscriptions
}
},
created: function () {
// region No comment detection
// For videos without any comment (comment disabled?)
// e.g. https://youtu.be/8NBSwDEf8a8
//
// `comments_entry_point_header` is null probably when comment disabled
if (this.forceState === 'noComment') {
this.commentData = []
this.nextPageToken = null
this.isLoading = false
this.showComments = true
}
// endregion No comment detection
},
methods: {
onTimestamp: function (timestamp) {
this.$emit('timestamp-event', timestamp)
Expand Down Expand Up @@ -255,6 +237,19 @@ export default defineComponent({
this.isLoading = false
this.showComments = true
} catch (err) {
// region No comment detection
// No comment related info when video info requested earlier in parent component
if (err.message.includes('Comments page did not have any content')) {
// For videos without any comment (comment disabled?)
// e.g. https://youtu.be/8NBSwDEf8a8
this.commentData = []
this.nextPageToken = null
this.isLoading = false
this.showComments = true
return
}
// endregion No comment detection

console.error(err)
const errorMessage = this.$t('Local API Error (Click to copy)')
showToast(`${errorMessage}: ${err}`, 10000, () => {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,9 +875,9 @@ export function getChannelPlaylistId(channelId, type, sortBy) {
}
case 'live':
if (sortBy === 'popular') {
return channelId.replace(/^UC/, 'UULV')
} else {
return channelId.replace(/^UC/, 'UUPV')
} else {
return channelId.replace(/^UC/, 'UULV')
}
case 'shorts':
if (sortBy === 'popular') {
Expand Down
12 changes: 0 additions & 12 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export default defineComponent({
playNextTimeout: null,
playNextCountDownIntervalId: null,
infoAreaSticky: true,
commentsEnabled: true,

onMountedRun: false,

Expand Down Expand Up @@ -486,17 +485,6 @@ export default defineComponent({
this.liveChat = null
}

// region No comment detection
// For videos without any comment (comment disabled?)
// e.g. https://youtu.be/8NBSwDEf8a8
//
// `comments_entry_point_header` is null probably when comment disabled
// e.g. https://youtu.be/8NBSwDEf8a8
// However videos with comments enabled but have no comment
// are different (which is not detected here)
this.commentsEnabled = result.comments_entry_point_header != null
// endregion No comment detection

if ((this.isLive || this.isPostLiveDvr) && !this.isUpcoming) {
let useRemoteManifest = true

Expand Down
1 change: 0 additions & 1 deletion src/renderer/views/Watch/Watch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@
:channel-thumbnail="channelThumbnail"
:channel-name="channelName"
:video-player-ready="videoPlayerLoaded"
:force-state="commentsEnabled ? null : 'noComment'"
@timestamp-event="changeTimestamp"
/>
</div>
Expand Down
Loading

0 comments on commit ab96588

Please sign in to comment.