From 33bb381035425ec1a5b832d3dd5cde7e50ae81df Mon Sep 17 00:00:00 2001 From: thecashewtrader Date: Thu, 3 Nov 2022 22:13:41 +0530 Subject: [PATCH 001/234] Make numberFormat respect language and region settings --- src/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 66bbb0eb..74aaa31b 100644 --- a/src/main.js +++ b/src/main.js @@ -88,7 +88,12 @@ const mixin = { return str; }, numberFormat(num) { - const formatter = Intl.NumberFormat(undefined, { notation: "compact" }); + const formatter = Intl.NumberFormat( + `${this.getPreferenceString("hl")}-${this.getPreferenceString("region")}`, + { + notation: "compact", + }, + ); return formatter.format(num); }, addCommas(num) { From fe64adf6d68d178409cb909fbc3209c802a071ec Mon Sep 17 00:00:00 2001 From: thecashewtrader Date: Thu, 3 Nov 2022 22:15:28 +0530 Subject: [PATCH 002/234] Fix typo: defaultLangage to defaultLanguage --- src/App.vue | 2 +- src/components/PreferencesPage.vue | 4 ++-- src/main.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 4db3bfb8..3b1dc465 100644 --- a/src/App.vue +++ b/src/App.vue @@ -64,7 +64,7 @@ export default { const App = this; (async function () { - const defaultLang = await App.defaultLangage; + const defaultLang = await App.defaultLanguage; const locale = App.getPreferenceString("hl", defaultLang); if (locale !== App.TimeAgoConfig.locale) { const localeTime = await import(`../node_modules/javascript-time-ago/locale/${locale}.json`) diff --git a/src/components/PreferencesPage.vue b/src/components/PreferencesPage.vue index 879f5119..80c1fcfb 100644 --- a/src/components/PreferencesPage.vue +++ b/src/components/PreferencesPage.vue @@ -506,7 +506,7 @@ export default { this.minimizeRecommendations = this.getPreferenceBoolean("minimizeRecommendations", false); this.watchHistory = this.getPreferenceBoolean("watchHistory", false); this.searchHistory = this.getPreferenceBoolean("searchHistory", false); - this.selectedLanguage = this.getPreferenceString("hl", await this.defaultLangage); + this.selectedLanguage = this.getPreferenceString("hl", await this.defaultLanguage); this.enabledCodecs = this.getPreferenceString("enabledCodecs", "vp9,avc").split(","); this.disableLBRY = this.getPreferenceBoolean("disableLBRY", false); this.proxyLBRY = this.getPreferenceBoolean("proxyLBRY", false); @@ -530,7 +530,7 @@ export default { if ( this.getPreferenceString("theme", "dark") !== this.selectedTheme || this.getPreferenceBoolean("watchHistory", false) != this.watchHistory || - this.getPreferenceString("hl", await this.defaultLangage) !== this.selectedLanguage || + this.getPreferenceString("hl", await this.defaultLanguage) !== this.selectedLanguage || this.getPreferenceString("enabledCodecs", "av1,vp9,avc") !== this.enabledCodecs.join(",") ) shouldReload = true; diff --git a/src/main.js b/src/main.js index 66bbb0eb..655cf88a 100644 --- a/src/main.js +++ b/src/main.js @@ -237,7 +237,7 @@ const mixin = { return false; } }, - async defaultLangage() { + async defaultLanguage() { const languages = window.navigator.languages; for (let i = 0; i < languages.length; i++) { try { From 7ac0940bd56f28257d327d02680ffbc33e000d51 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 3 Nov 2022 19:54:00 +0000 Subject: [PATCH 003/234] Try catch for NumberFormat. See https://github.com/TeamPiped/Piped/pull/1675#issuecomment-1302587072 --- src/main.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main.js b/src/main.js index 2671d470..efe2bae9 100644 --- a/src/main.js +++ b/src/main.js @@ -88,12 +88,17 @@ const mixin = { return str; }, numberFormat(num) { - const formatter = Intl.NumberFormat( - `${this.getPreferenceString("hl")}-${this.getPreferenceString("region")}`, - { - notation: "compact", - }, - ); + var loc = `${this.getPreferenceString("hl")}-${this.getPreferenceString("region")}`; + + try { + Intl.getCanonicalLocales(loc); + } catch { + loc = undefined; + } + + const formatter = Intl.NumberFormat(loc, { + notation: "compact", + }); return formatter.format(num); }, addCommas(num) { From a7039971d038377522e2a3b3dac1a4000f322eb2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Nov 2022 21:20:29 +0000 Subject: [PATCH 004/234] chore(deps): update dependency vite-plugin-pwa to v0.13.2 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index eb3faabb..584f469c 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "unocss": "0.46.3", "vite": "3.2.2", "vite-plugin-eslint": "1.8.1", - "vite-plugin-pwa": "0.13.1" + "vite-plugin-pwa": "0.13.2" }, "eslintConfig": { "root": true, diff --git a/yarn.lock b/yarn.lock index 735e13b4..00064bfd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3838,10 +3838,10 @@ vite-plugin-eslint@1.8.1: "@types/eslint" "^8.4.5" rollup "^2.77.2" -vite-plugin-pwa@0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.13.1.tgz#345133f947d4fc8252a1fd96f2fcb0e17c4201ae" - integrity sha512-NR3dIa+o2hzlzo4lF4Gu0cYvoMjSw2DdRc6Epw1yjmCqWaGuN86WK9JqZie4arNlE1ZuWT3CLiMdiX5wcmmUmg== +vite-plugin-pwa@0.13.2: + version "0.13.2" + resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.13.2.tgz#506b7c93c534ea44f2767249bfe2b35b9b0e8aa1" + integrity sha512-RwWJBaeMATrdicNFCXWb3aUELnmTk4Um72hE97nz9HKYG165kQGUE/TSrXOLExiPWJ23doV1Uw4IcHnOix17aA== dependencies: debug "^4.3.4" fast-glob "^3.2.11" From 9b9c67d4f573f01a0a739d018a5b4183dd7daf36 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 4 Nov 2022 09:27:28 +0000 Subject: [PATCH 005/234] chore(deps): update dependency @iconify/json to v2.1.133 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 584f469c..c6c3edd7 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "xml-js": "1.6.11" }, "devDependencies": { - "@iconify/json": "2.1.132", + "@iconify/json": "2.1.133", "@intlify/vite-plugin-vue-i18n": "6.0.3", "@unocss/preset-icons": "0.46.3", "@unocss/preset-web-fonts": "0.46.3", diff --git a/yarn.lock b/yarn.lock index 00064bfd..189e4193 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1005,10 +1005,10 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@iconify/json@2.1.132": - version "2.1.132" - resolved "https://registry.yarnpkg.com/@iconify/json/-/json-2.1.132.tgz#a78f23fb871164580a48cb99930babe6b90977d7" - integrity sha512-b2ddD44ufErLm18Aku0WNxKzFz1Rvtcb4rOoBtzOyQcttZUawQvE8e/wBHMLhaMRlEn0p4YlVOl6jjj0xmDYJg== +"@iconify/json@2.1.133": + version "2.1.133" + resolved "https://registry.yarnpkg.com/@iconify/json/-/json-2.1.133.tgz#85f329549e4bd92c4a8cd812d90c056f0d95d12b" + integrity sha512-m/BRPD74mGJNrQXByCK40VymdGocBko3SmPCIp3IV2mRY9EWa3tmCnn+HpqsMg0IZJAWMi9dQfI8bIShs+ZSrg== dependencies: "@iconify/types" "*" pathe "^0.3.0" From 8400361171c445dca39dac2afc7609ddc5f025f2 Mon Sep 17 00:00:00 2001 From: Malloc Voidstar <1284317+AlyoshaVasilieva@users.noreply.github.com> Date: Fri, 4 Nov 2022 18:32:03 -0700 Subject: [PATCH 006/234] Add Hong Kong region to CountryMaps --- src/utils/CountryMaps/de.json | 1 + src/utils/CountryMaps/el.json | 3 ++- src/utils/CountryMaps/en.json | 1 + src/utils/CountryMaps/es.json | 1 + src/utils/CountryMaps/fr.json | 1 + src/utils/CountryMaps/it.json | 1 + src/utils/CountryMaps/lt.json | 1 + src/utils/CountryMaps/pl.json | 1 + src/utils/CountryMaps/sk.json | 1 + src/utils/CountryMaps/sr.json | 1 + src/utils/CountryMaps/zh_Hant.json | 1 + 11 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/utils/CountryMaps/de.json b/src/utils/CountryMaps/de.json index 7e83bfa4..0caf3993 100644 --- a/src/utils/CountryMaps/de.json +++ b/src/utils/CountryMaps/de.json @@ -58,6 +58,7 @@ { "code": "GY", "name": "Guyana" }, { "code": "HT", "name": "Haiti" }, { "code": "HN", "name": "Honduras" }, + { "code": "HK", "name": "Hongkong" }, { "code": "IN", "name": "Indien" }, { "code": "ID", "name": "Indonesien" }, { "code": "IQ", "name": "Irak" }, diff --git a/src/utils/CountryMaps/el.json b/src/utils/CountryMaps/el.json index 87deece6..a97ad9fb 100644 --- a/src/utils/CountryMaps/el.json +++ b/src/utils/CountryMaps/el.json @@ -191,5 +191,6 @@ { "code": "PH", "name": "Φιλιππίνες" }, { "code": "FI", "name": "Φινλανδία" }, { "code": "FJ", "name": "Φίτζι" }, - { "code": "CL", "name": "Χιλή" } + { "code": "CL", "name": "Χιλή" }, + { "code": "HK", "name": "Χονγκ Κονγκ" } ] diff --git a/src/utils/CountryMaps/en.json b/src/utils/CountryMaps/en.json index 9eb09598..6d591dac 100644 --- a/src/utils/CountryMaps/en.json +++ b/src/utils/CountryMaps/en.json @@ -73,6 +73,7 @@ { "code": "GY", "name": "Guyana" }, { "code": "HT", "name": "Haiti" }, { "code": "HN", "name": "Honduras" }, + { "code": "HK", "name": "Hong Kong" }, { "code": "HU", "name": "Hungary" }, { "code": "IS", "name": "Iceland" }, { "code": "IN", "name": "India" }, diff --git a/src/utils/CountryMaps/es.json b/src/utils/CountryMaps/es.json index d97d5213..eae92966 100644 --- a/src/utils/CountryMaps/es.json +++ b/src/utils/CountryMaps/es.json @@ -76,6 +76,7 @@ { "code": "GY", "name": "Guyana" }, { "code": "HT", "name": "Haití" }, { "code": "HN", "name": "Honduras" }, + { "code": "HK", "name": "Hong Kong" }, { "code": "HU", "name": "Hungría" }, { "code": "IN", "name": "India" }, { "code": "ID", "name": "Indonesia" }, diff --git a/src/utils/CountryMaps/fr.json b/src/utils/CountryMaps/fr.json index a60db656..a721f787 100644 --- a/src/utils/CountryMaps/fr.json +++ b/src/utils/CountryMaps/fr.json @@ -77,6 +77,7 @@ { "code": "GY", "name": "Guyana" }, { "code": "HT", "name": "Haïti" }, { "code": "HN", "name": "Honduras" }, + { "code": "HK", "name": "Hong Kong" }, { "code": "HU", "name": "Hongrie" }, { "code": "IN", "name": "Inde" }, { "code": "ID", "name": "Indonésie" }, diff --git a/src/utils/CountryMaps/it.json b/src/utils/CountryMaps/it.json index 01891b86..c2b6b3a5 100644 --- a/src/utils/CountryMaps/it.json +++ b/src/utils/CountryMaps/it.json @@ -76,6 +76,7 @@ { "code": "GY", "name": "Guyana" }, { "code": "HT", "name": "Haiti" }, { "code": "HN", "name": "Honduras" }, + { "code": "HK", "name": "Hong Kong" }, { "code": "IN", "name": "India" }, { "code": "ID", "name": "Indonesia" }, { "code": "IR", "name": "Iran" }, diff --git a/src/utils/CountryMaps/lt.json b/src/utils/CountryMaps/lt.json index b1047592..8462905e 100644 --- a/src/utils/CountryMaps/lt.json +++ b/src/utils/CountryMaps/lt.json @@ -54,6 +54,7 @@ { "code": "GY", "name": "Gajana" }, { "code": "HT", "name": "Haitis" }, { "code": "HN", "name": "Hondūras" }, + { "code": "HK", "name": "Honkongas" }, { "code": "HU", "name": "Vengrija" }, { "code": "IS", "name": "Islandija" }, { "code": "IN", "name": "Indija" }, diff --git a/src/utils/CountryMaps/pl.json b/src/utils/CountryMaps/pl.json index 1f8303aa..07873090 100644 --- a/src/utils/CountryMaps/pl.json +++ b/src/utils/CountryMaps/pl.json @@ -65,6 +65,7 @@ { "code": "ES", "name": "Hiszpania" }, { "code": "NL", "name": "Holandia" }, { "code": "HN", "name": "Honduras" }, + { "code": "HK", "name": "Hongkong" }, { "code": "IN", "name": "Indie" }, { "code": "ID", "name": "Indonezja" }, { "code": "IQ", "name": "Irak" }, diff --git a/src/utils/CountryMaps/sk.json b/src/utils/CountryMaps/sk.json index a4530640..6310ba01 100644 --- a/src/utils/CountryMaps/sk.json +++ b/src/utils/CountryMaps/sk.json @@ -58,6 +58,7 @@ { "code": "HT", "name": "Haiti" }, { "code": "NL", "name": "Holandsko" }, { "code": "HN", "name": "Honduras" }, + { "code": "HK", "name": "Hongkong" }, { "code": "HR", "name": "Chorvátsko" }, { "code": "IN", "name": "India" }, { "code": "ID", "name": "Indonézia" }, diff --git a/src/utils/CountryMaps/sr.json b/src/utils/CountryMaps/sr.json index ab8eeab2..6fdfa0e7 100644 --- a/src/utils/CountryMaps/sr.json +++ b/src/utils/CountryMaps/sr.json @@ -73,6 +73,7 @@ { "code": "GY", "name": "Гајана" }, { "code": "HT", "name": "Хаити" }, { "code": "HN", "name": "Хондурас" }, + { "code": "HK", "name": "Хонгконг" }, { "code": "HU", "name": "Мађарска" }, { "code": "IS", "name": "Исланд" }, { "code": "IN", "name": "Индија" }, diff --git a/src/utils/CountryMaps/zh_Hant.json b/src/utils/CountryMaps/zh_Hant.json index ae031616..08b36531 100644 --- a/src/utils/CountryMaps/zh_Hant.json +++ b/src/utils/CountryMaps/zh_Hant.json @@ -73,6 +73,7 @@ { "code": "GY", "name": "蓋亞那" }, { "code": "HT", "name": "海地" }, { "code": "HN", "name": "宏都拉斯" }, + { "code": "HK", "name": "香港" }, { "code": "HU", "name": "匈牙利" }, { "code": "IS", "name": "冰島" }, { "code": "IN", "name": "印度" }, From f0fdd84bae86398427261c335f28914bc78991f3 Mon Sep 17 00:00:00 2001 From: thecashewtrader Date: Wed, 2 Nov 2022 21:40:27 +0530 Subject: [PATCH 007/234] Add Watch on YouTube button --- src/components/ChannelPage.vue | 19 +++++++++++++++++++ src/components/PlaylistPage.vue | 21 ++++++++++++++++++++- src/components/PreferencesPage.vue | 13 +++++++++++++ src/components/WatchVideo.vue | 20 +++++++++++++++++++- src/locales/en.json | 1 + src/main.js | 3 ++- 6 files changed, 74 insertions(+), 3 deletions(-) diff --git a/src/components/ChannelPage.vue b/src/components/ChannelPage.vue index c0c1d89d..297619f3 100644 --- a/src/components/ChannelPage.vue +++ b/src/components/ChannelPage.vue @@ -35,6 +35,25 @@ + + + + + + + + + + +
- + + + + + + + + + + + +
diff --git a/src/components/PreferencesPage.vue b/src/components/PreferencesPage.vue index 80c1fcfb..6df4d72a 100644 --- a/src/components/PreferencesPage.vue +++ b/src/components/PreferencesPage.vue @@ -96,6 +96,16 @@ @change="onChange($event)" /> + +