Skip to content

Commit df1a811

Browse files
committed
Merge branch 'fix/temp/api-ver' into feature/playlist-search-videos-in-one-user-playlist-2
* fix/temp/api-ver: (37 commits) workaround Hide date and views separator on the watch page when views are hidden (#4697) Translated using Weblate (Ukrainian) Translated using Weblate (Polish) Translated using Weblate (Estonian) Bump webpack from 5.90.1 to 5.90.3 (#4696) Bump sass from 1.70.0 to 1.71.0 (#4693) Bump electron from 28.2.2 to 28.2.3 (#4692) Bump the stylelint group with 1 update (#4691) Remove unused isLoading from ft-community-post (#4684) Include swiper version in CSS file name, for cache busting (#4685) Translated using Weblate (Chinese (Traditional)) Fix local API erroring when the view count is missing on the channel shorts tab (#4689) Translated using Weblate (Croatian) Translated using Weblate (Polish) Fix Hungarian Locale Name (#4686) Translated using Weblate (Dutch) Translated using Weblate (French) Translated using Weblate (Spanish) Bump marked from 11.2.0 to 12.0.0 (#4638) ...
2 parents 383d9c2 + cb29229 commit df1a811

Some content is hidden

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

75 files changed

+379
-435
lines changed

_scripts/webpack.renderer.config.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const CopyWebpackPlugin = require('copy-webpack-plugin')
1111

1212
const isDevMode = process.env.NODE_ENV === 'development'
1313

14+
const { version: swiperVersion } = JSON.parse(readFileSync(path.join(__dirname, '../node_modules/swiper/package.json')))
15+
1416
const processLocalesPlugin = new ProcessLocalesPlugin({
1517
compress: !isDevMode,
1618
inputDir: path.join(__dirname, '../static/locales'),
@@ -118,7 +120,8 @@ const config = {
118120
'process.env.IS_ELECTRON': true,
119121
'process.env.IS_ELECTRON_MAIN': false,
120122
'process.env.LOCALE_NAMES': JSON.stringify(processLocalesPlugin.localeNames),
121-
'process.env.GEOLOCATION_NAMES': JSON.stringify(readdirSync(path.join(__dirname, '..', 'static', 'geolocations')).map(filename => filename.replace('.json', '')))
123+
'process.env.GEOLOCATION_NAMES': JSON.stringify(readdirSync(path.join(__dirname, '..', 'static', 'geolocations')).map(filename => filename.replace('.json', ''))),
124+
'process.env.SWIPER_VERSION': `'${swiperVersion}'`
122125
}),
123126
new HtmlWebpackPlugin({
124127
excludeChunks: ['processTaskWorker'],
@@ -137,7 +140,7 @@ const config = {
137140
patterns: [
138141
{
139142
from: path.join(__dirname, '../node_modules/swiper/modules/{a11y,navigation,pagination}-element.css').replaceAll('\\', '/'),
140-
to: 'swiper.css',
143+
to: `swiper-${swiperVersion}.css`,
141144
context: path.join(__dirname, '../node_modules/swiper/modules'),
142145
transformAll: (assets) => {
143146
return Buffer.concat(assets.map(asset => asset.data))

_scripts/webpack.web.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const ProcessLocalesPlugin = require('./ProcessLocalesPlugin')
1111

1212
const isDevMode = process.env.NODE_ENV === 'development'
1313

14+
const { version: swiperVersion } = JSON.parse(fs.readFileSync(path.join(__dirname, '../node_modules/swiper/package.json')))
15+
1416
const config = {
1517
name: 'web',
1618
mode: process.env.NODE_ENV,
@@ -114,6 +116,7 @@ const config = {
114116
new webpack.DefinePlugin({
115117
'process.env.IS_ELECTRON': false,
116118
'process.env.IS_ELECTRON_MAIN': false,
119+
'process.env.SWIPER_VERSION': `'${swiperVersion}'`,
117120

118121
// video.js' vhs-utils supports both atob() in web browsers and Buffer in node
119122
// As the FreeTube web build only runs in web browsers, we can override their check for atob() here: https://github.com/videojs/vhs-utils/blob/main/src/decode-b64-to-uint8-array.js#L3
@@ -145,7 +148,7 @@ const config = {
145148
patterns: [
146149
{
147150
from: path.join(__dirname, '../node_modules/swiper/modules/{a11y,navigation,pagination}-element.css').replaceAll('\\', '/'),
148-
to: 'swiper.css',
151+
to: `swiper-${swiperVersion}.css`,
149152
context: path.join(__dirname, '../node_modules/swiper/modules'),
150153
transformAll: (assets) => {
151154
return Buffer.concat(assets.map(asset => asset.data))

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"autolinker": "^4.0.0",
6363
"electron-context-menu": "^3.6.1",
6464
"lodash.debounce": "^4.0.8",
65-
"marked": "^11.2.0",
65+
"marked": "^12.0.0",
6666
"path-browserify": "^1.0.1",
6767
"process": "^0.11.10",
6868
"swiper": "^11.0.6",
@@ -84,12 +84,12 @@
8484
"@babel/eslint-parser": "^7.23.10",
8585
"@babel/plugin-proposal-class-properties": "^7.18.6",
8686
"@babel/preset-env": "^7.23.9",
87-
"@double-great/stylelint-a11y": "^3.0.1",
87+
"@double-great/stylelint-a11y": "^3.0.2",
8888
"babel-loader": "^9.1.3",
8989
"copy-webpack-plugin": "^12.0.2",
9090
"css-loader": "^6.10.0",
9191
"css-minimizer-webpack-plugin": "^6.0.0",
92-
"electron": "^28.2.2",
92+
"electron": "^28.2.3",
9393
"electron-builder": "^24.9.1",
9494
"eslint": "^8.56.0",
9595
"eslint-config-prettier": "^9.1.0",
@@ -113,7 +113,7 @@
113113
"postcss-scss": "^4.0.9",
114114
"prettier": "^2.8.8",
115115
"rimraf": "^5.0.5",
116-
"sass": "^1.70.0",
116+
"sass": "^1.71.0",
117117
"sass-loader": "^14.1.0",
118118
"stylelint": "^16.2.1",
119119
"stylelint-config-sass-guidelines": "^11.0.0",
@@ -124,7 +124,7 @@
124124
"vue-devtools": "^5.1.4",
125125
"vue-eslint-parser": "^9.4.2",
126126
"vue-loader": "^15.10.0",
127-
"webpack": "^5.90.1",
127+
"webpack": "^5.90.3",
128128
"webpack-cli": "^5.1.4",
129129
"webpack-dev-server": "^4.15.1",
130130
"webpack-watch-external-files-plugin": "^3.0.0",

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ export default defineComponent({
11331133
})
11341134

11351135
if (process.env.IS_ELECTRON && this.backendFallback && this.backendPreference === 'invidious') {
1136-
showToast(this.$t('Falling back to the local API'))
1136+
showToast(this.$t('Falling back to Local API'))
11371137
resolve(this.getChannelInfoLocal(channelId))
11381138
} else {
11391139
resolve([])

src/renderer/components/ft-age-restricted/ft-age-restricted.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ import { defineComponent } from 'vue'
33
export default defineComponent({
44
name: 'FtAgeRestricted',
55
props: {
6-
contentTypeString: {
7-
type: String,
8-
required: true
9-
}
6+
isChannel: {
7+
type: Boolean,
8+
default: false,
9+
},
10+
isVideo: {
11+
type: Boolean,
12+
default: false,
13+
},
1014
},
1115
computed: {
1216
emoji: function () {
@@ -15,8 +19,11 @@ export default defineComponent({
1519
},
1620

1721
restrictedMessage: function () {
18-
const contentType = this.$t('Age Restricted.Type.' + this.contentTypeString)
19-
return this.$t('Age Restricted.This {videoOrPlaylist} is age restricted', { videoOrPlaylist: contentType })
22+
if (this.isChannel) {
23+
return this.$t('Age Restricted.This channel is age restricted')
24+
}
25+
26+
return this.$t('Age Restricted.This video is age restricted:')
2027
}
2128
}
2229
})

src/renderer/components/ft-community-post/ft-community-post.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export default defineComponent({
4040
voteCount: '',
4141
postContent: '',
4242
commentCount: '',
43-
isLoading: true,
4443
author: '',
4544
authorId: '',
4645
}
@@ -73,7 +72,7 @@ export default defineComponent({
7372
injectStylesUrls: [
7473
// This file is created with the copy webpack plugin in the web and renderer webpack configs.
7574
// If you add more modules, please remember to add their CSS files to the list in webpack config files.
76-
createWebURL('/swiper.css')
75+
createWebURL(`/swiper-${process.env.SWIPER_VERSION}.css`)
7776
],
7877

7978
a11y: true,
@@ -132,7 +131,6 @@ export default defineComponent({
132131
this.type = (this.data.postContent !== null && this.data.postContent !== undefined) ? this.data.postContent.type : 'text'
133132
this.author = this.data.author
134133
this.authorId = this.data.authorId
135-
this.isLoading = false
136134
},
137135

138136
getBestQualityImage(imageArray) {

src/renderer/components/ft-community-post/ft-community-post.vue

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
22
<div
3-
v-if="!isLoading"
43
class="ft-list-post ft-list-item outside"
54
:appearance="appearance"
65
:class="{ list: listType === 'list', grid: listType === 'grid' }"

src/renderer/components/ft-list-video/ft-list-video.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
<ft-icon-button
153153
class="optionsButton"
154154
:icon="['fas', 'ellipsis-v']"
155-
title="More Options"
155+
:title="$t('Video.More Options')"
156156
theme="base-no-default"
157157
:size="16"
158158
:use-shadow="false"

src/renderer/components/subscriptions-community/subscriptions-community.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export default defineComponent({
200200
copyToClipboard(err)
201201
})
202202
if (process.env.IS_ELECTRON && this.backendPreference === 'invidious' && this.backendFallback) {
203-
showToast(this.$t('Falling back to the local API'))
203+
showToast(this.$t('Falling back to Local API'))
204204
resolve(this.getChannelPostsLocal(channel))
205205
} else {
206206
resolve([])

src/renderer/components/subscriptions-live/subscriptions-live.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export default defineComponent({
282282
break
283283
case 1:
284284
if (process.env.IS_ELECTRON && this.backendFallback) {
285-
showToast(this.$t('Falling back to the local API'))
285+
showToast(this.$t('Falling back to Local API'))
286286
resolve(this.getChannelLiveLocal(channel, failedAttempts + 1))
287287
} else {
288288
resolve([])
@@ -321,7 +321,7 @@ export default defineComponent({
321321
return this.getChannelLiveInvidious(channel, failedAttempts + 1)
322322
case 1:
323323
if (process.env.IS_ELECTRON && this.backendFallback) {
324-
showToast(this.$t('Falling back to the local API'))
324+
showToast(this.$t('Falling back to Local API'))
325325
return this.getChannelLiveLocalRSS(channel, failedAttempts + 1)
326326
} else {
327327
return []

src/renderer/components/subscriptions-shorts/subscriptions-shorts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export default defineComponent({
213213
switch (failedAttempts) {
214214
case 0:
215215
if (process.env.IS_ELECTRON && this.backendFallback) {
216-
showToast(this.$t('Falling back to the local API'))
216+
showToast(this.$t('Falling back to Local API'))
217217
return this.getChannelShortsLocal(channel, failedAttempts + 1)
218218
} else {
219219
return []

src/renderer/components/subscriptions-videos/subscriptions-videos.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ export default defineComponent({
279279
break
280280
case 1:
281281
if (process.env.IS_ELECTRON && this.backendFallback) {
282-
showToast(this.$t('Falling back to the local API'))
282+
showToast(this.$t('Falling back to Local API'))
283283
resolve(this.getChannelVideosLocalScraper(channel, failedAttempts + 1))
284284
} else {
285285
resolve([])
@@ -319,7 +319,7 @@ export default defineComponent({
319319
return this.getChannelVideosInvidiousScraper(channel, failedAttempts + 1)
320320
case 1:
321321
if (process.env.IS_ELECTRON && this.backendFallback) {
322-
showToast(this.$t('Falling back to the local API'))
322+
showToast(this.$t('Falling back to Local API'))
323323
return this.getChannelVideosLocalRSS(channel, failedAttempts + 1)
324324
} else {
325325
return []

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export default defineComponent({
293293
copyToClipboard(err)
294294
})
295295
if (process.env.IS_ELECTRON && this.backendFallback && this.backendPreference === 'invidious') {
296-
showToast(this.$t('Falling back to local API'))
296+
showToast(this.$t('Falling back to Local API'))
297297
this.getCommentDataLocal()
298298
} else {
299299
this.isLoading = false

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
v-else-if="showComments && !isLoading"
269269
>
270270
<h3 class="noCommentMsg">
271-
{{ $t("There are no comments available for this video") }}
271+
{{ $t("Comments.There are no comments available for this video") }}
272272
</h3>
273273
</div>
274274
<h4

src/renderer/components/watch-video-info/watch-video-info.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
</div>
1010
<div class="videoMetrics">
1111
<div class="datePublishedAndViewCount">
12-
{{ publishedString }} {{ dateString }} • {{ parsedViewCount }}
12+
{{ publishedString }} {{ dateString }}
13+
<template v-if="!hideVideoViews">
14+
• {{ parsedViewCount }}
15+
</template>
1316
</div>
1417
<div
1518
v-if="!hideVideoLikesAndDislikes"

src/renderer/helpers/api/local.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export async function getLocalVideoInfo(id, attemptBypass = false) {
189189
// that's fine as we have most of the information from the original getInfo request
190190
info = await innertube.getBasicInfo(id, 'TV_EMBEDDED')
191191
} else {
192-
const innertube = await createInnertube({ withPlayer: true, generateSessionLocally: false })
192+
const innertube = await createInnertube({ withPlayer: true, generateSessionLocally: true })
193193
player = innertube.actions.session.player
194194

195195
info = await innertube.getInfo(id)
@@ -539,7 +539,7 @@ export function parseLocalChannelShorts(shorts, channelId, channelName) {
539539
title: short.title.text,
540540
author: channelName,
541541
authorId: channelId,
542-
viewCount: parseLocalSubscriberCount(short.views.text),
542+
viewCount: short.views.isEmpty() ? null : parseLocalSubscriberCount(short.views.text),
543543
lengthSeconds: ''
544544
}
545545
})

src/renderer/store/modules/invidious.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,21 @@ const actions = {
3939
console.error(err)
4040
}
4141
}
42+
4243
// If the invidious instance fetch isn't returning anything interpretable
4344
if (instances.length === 0) {
4445
// Fallback: read from static file
4546
const fileName = 'invidious-instances.json'
4647
/* eslint-disable-next-line n/no-path-concat */
4748
const fileLocation = process.env.NODE_ENV === 'development' ? './static/' : `${__dirname}/static/`
4849
const filePath = `${fileLocation}${fileName}`
49-
if (!process.env.IS_ELECTRON) {
50-
console.warn('reading static file for invidious instances')
51-
const fileData = process.env.IS_ELECTRON ? await fs.readFile(filePath, 'utf8') : await (await fetch(createWebURL(filePath))).text()
52-
instances = JSON.parse(fileData).filter(e => {
53-
return process.env.IS_ELECTRON || e.cors
54-
}).map(e => {
55-
return e.url
56-
})
57-
}
50+
console.warn('reading static file for invidious instances')
51+
const fileData = process.env.IS_ELECTRON ? await fs.readFile(filePath, 'utf8') : await (await fetch(createWebURL(filePath))).text()
52+
instances = JSON.parse(fileData).filter(e => {
53+
return process.env.IS_ELECTRON || e.cors
54+
}).map(e => {
55+
return e.url
56+
})
5857
}
5958
commit('setInvidiousInstancesList', instances)
6059
},

src/renderer/store/modules/settings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const state = {
289289
videoPlaybackRateInterval: 0.25,
290290
downloadAskPath: true,
291291
downloadFolderPath: '',
292-
downloadBehavior: 'download',
292+
downloadBehavior: 'open',
293293
enableScreenshot: false,
294294
screenshotFormat: 'png',
295295
screenshotQuality: 95,

src/renderer/views/Channel/Channel.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@
417417
<ft-age-restricted
418418
v-else-if="!isLoading && (!isFamilyFriendly && showFamilyFriendlyOnly)"
419419
class="ageRestricted"
420-
:content-type-string="'Channel'"
420+
:is-channel="true"
421421
/>
422422
</div>
423423
</template>

src/renderer/views/Playlist/Playlist.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export default defineComponent({
284284
const dateString = new Date(result.updated * 1000)
285285
this.lastUpdated = dateString.toLocaleDateString(this.currentLocale, { year: 'numeric', month: 'short', day: 'numeric' })
286286

287-
this.allPlaylistItems = result.videos
287+
this.playlistItems = result.videos
288288

289289
this.isLoading = false
290290
}).catch((err) => {

src/renderer/views/Watch/Watch.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<ft-age-restricted
8888
v-if="(!isLoading && !isFamilyFriendly && showFamilyFriendlyOnly)"
8989
class="ageRestricted"
90-
:content-type-string="'Video'"
90+
:is-video="true"
9191
/>
9292
<div
9393
v-if="(isFamilyFriendly || !showFamilyFriendlyOnly)"

static/locales/ar.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,7 @@ Video:
931931
Pause on Current Video: توقف مؤقتًا على الفيديو الحالي
932932
Unhide Channel: عرض القناة
933933
Hide Channel: إخفاء القناة
934+
More Options: المزيد من الخيارات
934935
Videos:
935936
#& Sort By
936937
Sort By:
@@ -1007,7 +1008,7 @@ Up Next: 'التالي'
10071008
Local API Error (Click to copy): 'خطأ API المحلي (انقر للنسخ)'
10081009
Invidious API Error (Click to copy): 'خطأ Invidious API ( انقر للنسخ)'
10091010
Falling back to Invidious API: 'التراجع إلى Invidious API'
1010-
Falling back to the local API: 'التراجع إلى API المحلي'
1011+
Falling back to Local API: 'التراجع إلى API المحلي'
10111012
Subscriptions have not yet been implemented: 'لم يتم تنفيذ الاشتراكات بعد'
10121013
Loop is now disabled: 'تم تعطيل التكرار'
10131014
Loop is now enabled: 'تم تمكين التكرار'
@@ -1131,11 +1132,6 @@ Starting download: بدء تنزيل "{videoTitle}"
11311132
Screenshot Success: تم حفظ لقطة الشاشة كا"{filePath}"
11321133
Screenshot Error: فشل أخذ لقطة للشاشة. {error}
11331134
New Window: نافذة جديدة
1134-
Age Restricted:
1135-
Type:
1136-
Channel: القناة
1137-
Video: فيديو
1138-
This {videoOrPlaylist} is age restricted: 'هذا {videoOrPlaylist} مقيد بالعمر'
11391135
Channels:
11401136
Count: تم العثور على قناة (قنوات) {number}.
11411137
Unsubscribed: 'تمت إزالة {channelName} من اشتراكاتك'
@@ -1172,3 +1168,7 @@ Trimmed input must be at least N characters long: يجب أن يكون طول ا
11721168
حرفًا واحدًا على الأقل | يجب أن يبلغ طول الإدخال المقتطع {length} من الأحرف على
11731169
الأقل
11741170
Tag already exists: العلامة "{tagName}" موجودة بالفعل
1171+
Age Restricted:
1172+
This channel is age restricted: هذه القناة مقيدة بالعمر
1173+
This video is age restricted: هذا الفيديو مقيد بالفئة العمرية
1174+
Close Banner: إغلاق الشعار

0 commit comments

Comments
 (0)