Skip to content

Commit 5d7cac4

Browse files
committed
Merge branch 'development' into feature/history/remember-search-query
* development: (49 commits) Translated using Weblate (Japanese) Translated using Weblate (French) Fix long comments overflowing and breaking the layout (FreeTubeApp#5774) Cleanup unused code in the store (FreeTubeApp#5776) Revert "Larger search/URL bar (FreeTubeApp#5348)" (FreeTubeApp#5773) Fix loading from search cache failing when no features are selected (FreeTubeApp#5775) Bump lefthook from 1.7.15 to 1.7.17 (FreeTubeApp#5768) Bump webpack from 5.94.0 to 5.95.0 (FreeTubeApp#5770) Bump sass from 1.79.3 to 1.79.4 (FreeTubeApp#5771) Translated using Weblate (Chinese (Traditional Han script)) Change the Proxy Videos Through Invidious setting to only apply when using the Invidious API (FreeTubeApp#5758) Support copying post links from the context menu (FreeTubeApp#5760) Local API: Fix error when a community post has no likes (FreeTubeApp#5759) Translated using Weblate (English (United Kingdom)) Translated using Weblate (Dutch) Translated using Weblate (Swedish) Do not overwrite cache entries when hitting RSS ratelimits (FreeTubeApp#5756) Translated using Weblate (Czech) Translated using Weblate (Hungarian) Translated using Weblate (Hungarian) ...
2 parents 54f4331 + d42cb9d commit 5d7cac4

File tree

90 files changed

+816
-557
lines changed

Some content is hidden

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

90 files changed

+816
-557
lines changed

_scripts/getRegions.mjs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ for (const language of youTubeLanguages) {
4646
youTube: language,
4747
freeTube: language
4848
})
49-
} else if (activeLanguages.includes(language.replace('-', '_'))) {
50-
const withUnderScore = language.replace('-', '_')
51-
foundLanguageNames.push(withUnderScore)
52-
languagesToScrape.push({
53-
youTube: language,
54-
freeTube: withUnderScore
55-
})
5649
}
5750
// special cases
5851
else if (language === 'de') {
@@ -70,10 +63,10 @@ for (const language of youTubeLanguages) {
7063
} else if (language === 'no') {
7164
// according to https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
7265
// "no" is the macro language for "nb" and "nn"
73-
foundLanguageNames.push('nb_NO', 'nn')
66+
foundLanguageNames.push('nb-NO', 'nn')
7467
languagesToScrape.push({
7568
youTube: 'no',
76-
freeTube: 'nb_NO'
69+
freeTube: 'nb-NO'
7770
})
7871
languagesToScrape.push({
7972
youTube: 'no',
@@ -88,10 +81,10 @@ for (const language of youTubeLanguages) {
8881
freeTube: 'he'
8982
})
9083
} else if (language === 'es-419') {
91-
foundLanguageNames.push('es_AR', 'es-MX')
84+
foundLanguageNames.push('es-AR', 'es-MX')
9285
languagesToScrape.push({
9386
youTube: 'es-419',
94-
freeTube: 'es_AR'
87+
freeTube: 'es-AR'
9588
})
9689
languagesToScrape.push({
9790
youTube: 'es-419',

_scripts/getShakaLocales.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,10 @@ function getMappings(shakaLocales, freeTubeLocales) {
4141
locale,
4242
locale
4343
])
44-
} else if (shakaLocales.has(locale.replace('_', '-'))) {
44+
} else if (shakaLocales.has(locale.split('-')[0])) {
4545
mappings.push([
4646
locale,
47-
locale.replace('_', '-')
48-
])
49-
} else if (shakaLocales.has(locale.split(/[-_]/)[0])) {
50-
mappings.push([
51-
locale,
52-
locale.split(/[-_]/)[0]
47+
locale.split('-')[0]
5348
])
5449
}
5550
}
@@ -60,7 +55,7 @@ function getMappings(shakaLocales, freeTubeLocales) {
6055
// according to https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
6156
// "no" is the macro language for "nb" and "nn"
6257
[
63-
'nb_NO',
58+
'nb-NO',
6459
'no'
6560
],
6661
[

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"path-browserify": "^1.0.1",
6868
"portal-vue": "^2.1.7",
6969
"process": "^0.11.10",
70-
"shaka-player": "^4.11.3",
70+
"shaka-player": "^4.11.4",
7171
"swiper": "^11.1.14",
7272
"vue": "^2.7.16",
7373
"vue-i18n": "^8.28.2",
@@ -83,18 +83,18 @@
8383
"@babel/preset-env": "^7.25.4",
8484
"@double-great/stylelint-a11y": "^3.0.2",
8585
"@intlify/eslint-plugin-vue-i18n": "^3.0.0",
86-
"babel-loader": "^9.1.3",
86+
"babel-loader": "^9.2.1",
8787
"copy-webpack-plugin": "^12.0.2",
8888
"css-loader": "^7.1.2",
8989
"css-minimizer-webpack-plugin": "^7.0.0",
90-
"electron": "^32.1.0",
90+
"electron": "^32.1.2",
9191
"electron-builder": "^24.13.3",
92-
"eslint": "^8.57.0",
92+
"eslint": "^8.57.1",
9393
"eslint-config-prettier": "^9.1.0",
9494
"eslint-config-standard": "^17.1.0",
9595
"eslint-plugin-import": "^2.30.0",
9696
"eslint-plugin-jsonc": "^2.16.0",
97-
"eslint-plugin-n": "^17.10.2",
97+
"eslint-plugin-n": "^17.10.3",
9898
"eslint-plugin-prettier": "^5.2.1",
9999
"eslint-plugin-promise": "^7.1.0",
100100
"eslint-plugin-unicorn": "^55.0.0",
@@ -104,15 +104,15 @@
104104
"html-webpack-plugin": "^5.6.0",
105105
"js-yaml": "^4.1.0",
106106
"json-minimizer-webpack-plugin": "^5.0.0",
107-
"lefthook": "^1.7.15",
107+
"lefthook": "^1.7.17",
108108
"mini-css-extract-plugin": "^2.9.1",
109109
"npm-run-all2": "^6.2.3",
110110
"postcss": "^8.4.47",
111111
"postcss-scss": "^4.0.9",
112112
"prettier": "^2.8.8",
113113
"rimraf": "^6.0.1",
114-
"sass": "^1.78.0",
115-
"sass-loader": "^16.0.1",
114+
"sass": "^1.79.4",
115+
"sass-loader": "^16.0.2",
116116
"stylelint": "^16.9.0",
117117
"stylelint-config-sass-guidelines": "^12.1.0",
118118
"stylelint-config-standard": "^36.0.1",
@@ -122,7 +122,7 @@
122122
"vue-devtools": "^5.1.4",
123123
"vue-eslint-parser": "^9.4.3",
124124
"vue-loader": "^15.10.0",
125-
"webpack": "^5.94.0",
125+
"webpack": "^5.95.0",
126126
"webpack-cli": "^5.1.4",
127127
"webpack-dev-server": "^5.1.0",
128128
"yaml-eslint-parser": "^1.2.3"

src/datastores/handlers/base.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import * as db from '../index'
22

33
class Settings {
4-
static find() {
4+
static async find() {
5+
const currentLocale = await db.settings.findOneAsync({ _id: 'currentLocale' })
6+
7+
// In FreeTube 0.21.3 and earlier the locales 'en-GB', 'es-AR' and 'nb-NO' had underscores instead of a hyphens
8+
// This is a one time migration for users that are using one of those locales
9+
if (currentLocale?.value.includes('_')) {
10+
await this.upsert('currentLocale', currentLocale.value.replace('_', '-'))
11+
}
12+
513
return db.settings.findAsync({ _id: { $ne: 'bounds' } })
614
}
715

src/main/index.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function runApp() {
8787
const path = urlParts[1]
8888

8989
if (path) {
90-
visible = ['/channel', '/watch', '/hashtag'].some(p => path.startsWith(p)) ||
90+
visible = ['/channel', '/watch', '/hashtag', '/post'].some(p => path.startsWith(p)) ||
9191
// Only show copy link entry for non user playlists
9292
(path.startsWith('/playlist') && !/playlistType=user/.test(path))
9393
}
@@ -157,6 +157,21 @@ function runApp() {
157157

158158
return url.toString()
159159
}
160+
case 'post': {
161+
if (query) {
162+
const authorId = new URLSearchParams(query).get('authorId')
163+
164+
if (authorId) {
165+
if (toYouTube) {
166+
return `${origin}/channel/${authorId}/community?lb=${id}`
167+
} else {
168+
return `${origin}/post/${id}?ucid=${authorId}`
169+
}
170+
}
171+
}
172+
173+
return `${origin}/post/${id}`
174+
}
160175
}
161176
}
162177

src/renderer/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default defineComponent({
8383
windowTitle: function () {
8484
const routePath = this.$route.path
8585
if (!routePath.startsWith('/channel/') && !routePath.startsWith('/watch/') && !routePath.startsWith('/hashtag/') && !routePath.startsWith('/playlist/')) {
86-
let title = translateWindowTitle(this.$route.meta.title, this.$i18n)
86+
let title = translateWindowTitle(this.$route.meta.title)
8787
if (!title) {
8888
title = packageDetails.productName
8989
} else {
@@ -122,7 +122,7 @@ export default defineComponent({
122122
},
123123

124124
locale: function() {
125-
return this.$i18n.locale.replace('_', '-')
125+
return this.$i18n.locale
126126
},
127127

128128
systemTheme: function () {

src/renderer/components/channel-about/channel-about.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default defineComponent({
5555
},
5656

5757
currentLocale: function () {
58-
return this.$i18n.locale.replace('_', '-')
58+
return this.$i18n.locale
5959
},
6060

6161
formattedJoined: function () {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ export default defineComponent({
364364
},
365365

366366
currentLocale: function () {
367-
return this.$i18n.locale.replace('_', '-')
367+
return this.$i18n.locale
368368
},
369369

370370
externalPlayer: function () {

src/renderer/components/ft-playlist-add-video-prompt/ft-playlist-add-video-prompt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default defineComponent({
119119
return this.$store.getters.getNewPlaylistDefaultProperties
120120
},
121121
locale: function () {
122-
return this.$i18n.locale.replace('_', '-')
122+
return this.$i18n.locale
123123
},
124124
processedQuery: function() {
125125
return this.query.trim().toLowerCase()

src/renderer/components/ft-profile-bubble/ft-profile-bubble.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineComponent({
2626
emits: ['click'],
2727
computed: {
2828
locale: function () {
29-
return this.$i18n.locale.replace('_', '-')
29+
return this.$i18n.locale
3030
},
3131
isMainProfile: function () {
3232
return this.profileId === MAIN_PROFILE_ID

src/renderer/components/ft-profile-channel-list/ft-profile-channel-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default defineComponent({
6666
]
6767
},
6868
locale: function () {
69-
return this.$i18n.locale.replace('_', '-')
69+
return this.$i18n.locale
7070
},
7171
},
7272
watch: {

src/renderer/components/ft-profile-edit/ft-profile-edit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default defineComponent({
4949
},
5050
computed: {
5151
locale: function () {
52-
return this.$i18n.locale.replace('_', '-')
52+
return this.$i18n.locale
5353
},
5454
colorValues: function () {
5555
return colors.map(color => color.value)

src/renderer/components/ft-profile-filter-channels-list/ft-profile-filter-channels-list.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default defineComponent({
4949
return this.$t('Profile.{number} selected', { number: this.selectedLength })
5050
},
5151
locale: function () {
52-
return this.$i18n.locale.replace('_', '-')
52+
return this.$i18n.locale
5353
}
5454
},
5555
watch: {

src/renderer/components/ft-profile-selector/ft-profile-selector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default defineComponent({
2121
},
2222
computed: {
2323
locale: function () {
24-
return this.$i18n.locale.replace('_', '-')
24+
return this.$i18n.locale
2525
},
2626
profileList: function () {
2727
return this.$store.getters.getProfileList

src/renderer/components/ft-select/ft-select.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
v-for="(name, index) in selectNames"
1616
:key="index"
1717
:value="selectValues[index]"
18-
:lang="isLocaleSelector && selectValues[index] !== 'system' ? selectValues[index].replace('_', '-') : null"
18+
:lang="isLocaleSelector && selectValues[index] !== 'system' ? selectValues[index] : null"
1919
>
2020
{{ name }}
2121
</option>

src/renderer/components/ft-subscribe-button/ft-subscribe-button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default defineComponent({
5151
},
5252
computed: {
5353
locale: function () {
54-
return this.$i18n.locale.replace('_', '-')
54+
return this.$i18n.locale
5555
},
5656
profileInitials: function () {
5757
return this.profileDisplayList.map((profile) => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default defineComponent({
9696
return this.$router.getRoutes().filter((route) => includedPageNames.includes(route.name))
9797
},
9898
defaultPageNames: function () {
99-
return this.defaultPages.map((route) => translateWindowTitle(route.meta.title, this.$i18n))
99+
return this.defaultPages.map((route) => translateWindowTitle(route.meta.title))
100100
},
101101
defaultPageValues: function () {
102102
// avoid Vue parsing issues by excluding '/' from path values

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ export default defineComponent({
6767
return this.$store.getters.getBackendPreference
6868
},
6969

70+
backendFallback: function () {
71+
return this.$store.getters.getBackendFallback
72+
},
73+
7074
autoplayVideos: function () {
7175
return this.$store.getters.getAutoplayVideos
7276
},
@@ -87,6 +91,10 @@ export default defineComponent({
8791
return this.$store.getters.getProxyVideos
8892
},
8993

94+
showProxyVideosAsDisabled: function () {
95+
return this.backendPreference !== 'invidious' && !this.backendFallback
96+
},
97+
9098
defaultSkipInterval: function () {
9199
return parseInt(this.$store.getters.getDefaultSkipInterval)
92100
},

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<ft-toggle-switch
88
:label="$t('Settings.Player Settings.Proxy Videos Through Invidious')"
99
:compact="true"
10-
:default-value="proxyVideos"
10+
:default-value="showProxyVideosAsDisabled ? false : proxyVideos"
11+
:disabled="showProxyVideosAsDisabled"
1112
:tooltip="$t('Tooltips.Player Settings.Proxy Videos Through Invidious')"
1213
@change="updateProxyVideos"
1314
/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default defineComponent({
6464
return `${this.proxyProtocol}://${this.proxyHostname}:${this.proxyPort}`
6565
},
6666
lang: function() {
67-
return this.$i18n.locale.replace('_', '-')
67+
return this.$i18n.locale
6868
},
6969
localeToUse: function() {
7070
// locales found here: https://ipwhois.io/documentation

src/renderer/components/side-nav/side-nav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default defineComponent({
3030
return this.$store.getters.getActiveProfile
3131
},
3232
locale: function () {
33-
return this.$i18n.locale.replace('_', '-')
33+
return this.$i18n.locale
3434
},
3535
activeSubscriptions: function () {
3636
const subscriptions = deepCopy(this.activeProfile.subscriptions)

0 commit comments

Comments
 (0)