Skip to content

Commit 102bf72

Browse files
authored
Merge branch 'FreeTubeApp:development' into playbackrate
2 parents 2b003da + 22d7777 commit 102bf72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+324
-512
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"css-loader": "^7.1.2",
8787
"css-minimizer-webpack-plugin": "^7.0.2",
8888
"electron": "^37.2.3",
89-
"electron-builder": "^26.0.18",
89+
"electron-builder": "^26.0.19",
9090
"eslint": "^9.31.0",
9191
"eslint-plugin-jsdoc": "^51.4.1",
9292
"eslint-plugin-jsonc": "^2.20.1",

src/renderer/components/SubscriptionSettings/SubscriptionSettings.vue

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
/>
2727
</div>
2828
<div class="switchColumn">
29-
<FtToggleSwitch
30-
:label="$t('Settings.Subscription Settings.Hide Videos on Watch')"
31-
:default-value="hideWatchedSubs"
32-
compact
33-
@change="updateHideWatchedSubs"
34-
/>
3529
<FtToggleSwitch
3630
:label="$t('Settings.Subscription Settings.Limit the number of videos displayed for each channel')"
3731
:default-value="onlyShowLatestFromChannel"
@@ -93,16 +87,6 @@ function updateUnsubscriptionPopupStatus(value) {
9387
store.dispatch('updateUnsubscriptionPopupStatus', value)
9488
}
9589
96-
/** @type {import('vue').ComputedRef<boolean>} */
97-
const hideWatchedSubs = computed(() => store.getters.getHideWatchedSubs)
98-
99-
/**
100-
* @param {boolean} value
101-
*/
102-
function updateHideWatchedSubs(value) {
103-
store.dispatch('updateHideWatchedSubs', value)
104-
}
105-
10690
/** @type {import('vue').ComputedRef<boolean>} */
10791
const onlyShowLatestFromChannel = computed(() => store.getters.getOnlyShowLatestFromChannel)
10892

src/renderer/components/distraction-settings/distraction-settings.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ export default defineComponent({
142142
settingsSection: this.$t('Settings.Distraction Free Settings.Distraction Free Settings')
143143
})
144144
},
145+
hideWatchedSubs: function () {
146+
return this.$store.getters.getHideWatchedSubs
147+
},
145148
},
146149
mounted: function () {
147150
this.verifyChannelsHidden()
@@ -245,6 +248,7 @@ export default defineComponent({
245248
'updateHideSubscriptionsCommunity',
246249
'updateShowAddedChannelsHidden',
247250
'updateShowAddedForbiddenTitles',
248-
])
249-
}
251+
'updateHideWatchedSubs',
252+
]),
253+
},
250254
})

src/renderer/components/distraction-settings/distraction-settings.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@
217217
:default-value="hideSharingActions"
218218
@change="updateHideSharingActions"
219219
/>
220+
<ft-toggle-switch
221+
:label="$t('Settings.Distraction Free Settings.Hide Videos on Watch')"
222+
:default-value="hideWatchedSubs"
223+
:compact="true"
224+
:tooltip="$t('Tooltips.Distraction Free Settings.Hide Videos on Watch')"
225+
@change="updateHideWatchedSubs"
226+
/>
220227
</div>
221228
<div class="switchColumn">
222229
<ft-toggle-switch

src/renderer/helpers/api/local.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,6 +1649,8 @@ export function parseLocalComment(comment, commentThread = undefined) {
16491649
hasReplyToken = true
16501650
}
16511651

1652+
const commentTextRuns = comment.voice_reply_container?.transcript_text ? comment.voice_reply_container.transcript_text.runs : comment.content.runs
1653+
16521654
return {
16531655
id: comment.comment_id,
16541656
dataType: 'local',
@@ -1659,7 +1661,7 @@ export function parseLocalComment(comment, commentThread = undefined) {
16591661
isPinned: comment.is_pinned,
16601662
isOwner: !!comment.author_is_channel_owner,
16611663
isMember: !!comment.is_member,
1662-
text: Autolinker.link(parseLocalTextRuns(comment.content.runs, 16, { looseChannelNameDetection: true })),
1664+
text: Autolinker.link(parseLocalTextRuns(commentTextRuns, 16, { looseChannelNameDetection: true })),
16631665
isHearted: !!comment.is_hearted,
16641666
hasOwnerReplied,
16651667
hasReplyToken,

src/renderer/views/Channel/Channel.vue

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<div class="select-container">
4242
<FtSelect
4343
v-if="showVideoSortBy"
44-
v-show="currentTab === 'videos' && latestVideos.length > 0"
44+
v-show="currentTab === 'videos' && (showFetchMoreButton || filteredVideos.length > 1)"
4545
:value="videoSortBy"
4646
:select-names="videoLiveShortSelectNames"
4747
:select-values="videoLiveShortSelectValues"
@@ -51,7 +51,7 @@
5151
/>
5252
<FtSelect
5353
v-if="!hideChannelShorts && showShortSortBy"
54-
v-show="currentTab === 'shorts' && latestShorts.length > 0"
54+
v-show="currentTab === 'shorts' && (showFetchMoreButton || filteredShorts.length > 1)"
5555
:value="shortSortBy"
5656
:select-names="videoLiveShortSelectNames"
5757
:select-values="videoLiveShortSelectValues"
@@ -61,7 +61,7 @@
6161
/>
6262
<FtSelect
6363
v-if="!hideLiveStreams && showLiveSortBy"
64-
v-show="currentTab === 'live' && latestLive.length > 0"
64+
v-show="currentTab === 'live' && (showFetchMoreButton || filteredLive.length > 1)"
6565
:value="liveSortBy"
6666
:select-names="videoLiveShortSelectNames"
6767
:select-values="videoLiveShortSelectValues"
@@ -97,7 +97,7 @@
9797
<FtElementList
9898
v-show="currentTab === 'videos'"
9999
id="videoPanel"
100-
:data="latestVideos"
100+
:data="filteredVideos"
101101
:use-channels-hidden-preference="false"
102102
role="tabpanel"
103103
aria-labelledby="videosTab"
@@ -112,7 +112,7 @@
112112
<FtElementList
113113
v-if="!hideChannelShorts && currentTab === 'shorts'"
114114
id="shortPanel"
115-
:data="latestShorts"
115+
:data="filteredShorts"
116116
:use-channels-hidden-preference="false"
117117
role="tabpanel"
118118
aria-labelledby="shortsTab"
@@ -128,7 +128,7 @@
128128
v-if="!hideLiveStreams"
129129
v-show="currentTab === 'live'"
130130
id="livePanel"
131-
:data="latestLive"
131+
:data="filteredLive"
132132
:use-channels-hidden-preference="false"
133133
role="tabpanel"
134134
aria-labelledby="liveTab"
@@ -469,6 +469,9 @@ const hideChannelPlaylists = computed(() => store.getters.getHideChannelPlaylist
469469
/** @type {import('vue').ComputedRef<boolean>} */
470470
const hideChannelCommunity = computed(() => store.getters.getHideChannelCommunity)
471471
472+
/** @type {import('vue').ComputedRef<boolean>} */
473+
const hideWatchedSubs = computed(() => store.getters.getHideWatchedSubs)
474+
472475
/**
473476
* @template T
474477
* @param {T[]} array
@@ -1048,6 +1051,30 @@ const videoContinuationData = shallowRef(null)
10481051
const showVideoSortBy = ref(true)
10491052
const videoSortBy = ref('newest')
10501053
1054+
const filteredVideos = computed(() => {
1055+
if (hideWatchedSubs.value) {
1056+
return filterWatchedArray(latestVideos.value)
1057+
} else {
1058+
return latestVideos.value
1059+
}
1060+
})
1061+
1062+
const filteredShorts = computed(() => {
1063+
if (hideWatchedSubs.value) {
1064+
return filterWatchedArray(latestShorts.value)
1065+
} else {
1066+
return latestShorts.value
1067+
}
1068+
})
1069+
1070+
const filteredLive = computed(() => {
1071+
if (hideWatchedSubs.value) {
1072+
return filterWatchedArray(latestLive.value)
1073+
} else {
1074+
return latestLive.value
1075+
}
1076+
})
1077+
10511078
watch(videoSortBy, () => {
10521079
if (!autoRefreshOnSortByChangeEnabled) { return }
10531080
@@ -2315,6 +2342,11 @@ function handleSubscription() {
23152342
posts: latestCommunityPosts.value
23162343
})
23172344
}
2345+
2346+
function filterWatchedArray(videos) {
2347+
const historyCache = store.getters.getHistoryCacheById
2348+
return videos.filter(video => !Object.hasOwn(historyCache, video.videoId))
2349+
}
23182350
</script>
23192351
23202352
<style scoped src="./Channel.css" />

static/locales/af.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,6 @@ Settings:
521521
Clear Search History and Cache: Wis soekgeskiedenis en kasgeheue
522522
Subscription Settings:
523523
Subscription Settings: 'Intekening'
524-
Hide Videos on Watch: 'Versteek alle gekykte video’s'
525524
Fetch Feeds from RSS: 'Haal voer vanaf RSS op'
526525
Fetch Automatically: 'Haal voer outomaties op'
527526
Confirm Before Unsubscribing: 'Bevestig voor uittekening'
@@ -554,6 +553,7 @@ Settings:
554553
Hide Live Streams: 'Versteek direkte strome'
555554
Hide Upcoming Premieres: 'Versteek komende premières'
556555
Hide Sharing Actions: 'Versteek deel-aksies'
556+
Hide Videos on Watch: 'Versteek alle gekykte video’s'
557557
Hide Chapters: 'Versteek hoofstukke'
558558
Hide Channels: 'Versteek video’s van kanale'
559559
Hide Channels Disabled Message: 'Sommige kanale is met ID versper en is nie verwerk

static/locales/ar.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ Settings:
453453
Tooltip: 'تلقائي = حفظ عند كل خروج من صفحة الفيديو، عند انتهاء الفيديو وظهور خطأ (مثلاً: معدل محدود أو انتهاء جلسة المشاهدة). شبه تلقائي = يُشبه الوضع التلقائي إلا عند الخروج من صفحة الفيديو، ويمكن حفظ التقدم يدويًا عبر زر "حفظ تقدم المشاهدة" الموجود أسفل مشغل الفيديو.'
454454
Subscription Settings:
455455
Subscription Settings: 'الاشتراك'
456-
Hide Videos on Watch: 'أخفِ الفيديوهات عند مشاهدتها'
457456
Fetch Feeds from RSS: 'جلب المحتوى عن طريق RSS'
458457
Fetch Automatically: جلب الخلاصة تلقائيا
459458
Confirm Before Unsubscribing: تجنب إلغاء الاشتراك عن طريق الخطأ
@@ -511,6 +510,7 @@ Settings:
511510
Hide Video Description: إخفاء وصف الفيديو
512511
Hide Comments: إخفاء التعليقات
513512
Hide Sharing Actions: إخفاء إجراءات المشاركة
513+
Hide Videos on Watch: 'أخفِ الفيديوهات عند مشاهدتها'
514514
Hide Live Streams: إخفاء البث المباشر
515515
Hide Chapters: إخفاء الفصول
516516
Hide Upcoming Premieres: إخفاء العروض الأولى القادمة

static/locales/awa.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,6 @@ Settings:
497497
Are you sure you want to remove all your playlists?: ''
498498
Subscription Settings:
499499
Subscription Settings: ''
500-
Hide Videos on Watch: ''
501500
Fetch Feeds from RSS: ''
502501
Fetch Automatically: ''
503502
'Limit the number of videos displayed for each channel': ''

static/locales/be.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ Settings:
482482
Tooltip: Аўта = Захоўваць пры кожным выхадзе са старонкі відэа, калі відэа скончылася і ўзнікла памылка (напрыклад, хуткасць абмежавана і сеанс прагляду скончыўся). Паўаўтаматычны = як і аўтаматычны, за выключэннем выхаду з відэастаронкі і захавання прагрэсу ўручную з дапамогай кнопкі пад назвай "Захаваць прагледжаны прагрэс", размешчанай пад відэаплэерам.
483483
Subscription Settings:
484484
Subscription Settings: 'Падпіскі'
485-
Hide Videos on Watch: 'Хаваць відэа пасля прагляду'
486485
Fetch Feeds from RSS: 'Атрымліваць стужкі з RSS'
487486
Fetch Automatically: 'Атрымліваць стужку аўтаматычна'
488487
Confirm Before Unsubscribing: Пацвярджаць адпісванне
@@ -513,6 +512,7 @@ Settings:
513512
Hide Live Streams: 'Хаваць жывыя эфіры'
514513
Hide Upcoming Premieres: 'Хаваць будучыя прэм''еры'
515514
Hide Sharing Actions: 'Хаваць дзеянні абагульвання'
515+
Hide Videos on Watch: 'Хаваць відэа пасля прагляду'
516516
Hide Chapters: 'Хаваць раздзелы'
517517
Hide Channels: 'Хаваць відэа з каналаў'
518518
Hide Channels Placeholder: 'Ідэнтыфікатар канала'

0 commit comments

Comments
 (0)