1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-17 07:40:27 +05:30
Piped/src/components/PreferencesPage.vue

417 lines
18 KiB
Vue
Raw Normal View History

2020-11-17 10:45:35 +05:30
<template>
<div class="flex">
<button @click="$router.go(-1) || $router.push('/')">
2021-12-27 21:59:25 +05:30
<font-awesome-icon icon="chevron-left" /><span class="ml-1.5" v-text="$t('actions.back')" />
</button>
</div>
<h1 v-t="'titles.preferences'" class="font-bold text-center" />
2020-11-22 10:04:27 +05:30
<hr />
2021-02-25 20:10:40 +05:30
<h2>SponsorBlock</h2>
<p>
<span v-text="$t('actions.uses_api_from')" /><a class="link" href="https://sponsor.ajay.app/"
>sponsor.ajay.app</a
>
</p>
<label for="chkEnableSponsorblock"><strong v-t="'actions.enable_sponsorblock'" /></label>
2021-02-25 20:10:40 +05:30
<br />
<input
id="chkEnableSponsorblock"
v-model="sponsorBlock"
class="checkbox"
type="checkbox"
@change="onChange($event)"
/>
2021-02-25 20:48:59 +05:30
<br />
<label for="chkSkipSponsors"><strong v-t="'actions.skip_sponsors'" /></label>
2021-02-25 20:48:59 +05:30
<br />
<input id="chkSkipSponsors" v-model="skipSponsor" class="checkbox" type="checkbox" @change="onChange($event)" />
2021-02-25 20:48:59 +05:30
<br />
<label for="chkSkipIntro"><strong v-t="'actions.skip_intro'" /></label>
2021-02-25 20:48:59 +05:30
<br />
<input id="chkSkipIntro" v-model="skipIntro" class="checkbox" type="checkbox" @change="onChange($event)" />
2021-02-25 20:48:59 +05:30
<br />
<label for="chkSkipOutro"><strong v-t="'actions.skip_outro'" /></label>
2021-02-25 20:48:59 +05:30
<br />
<input id="chkSkipOutro" v-model="skipOutro" class="checkbox" type="checkbox" @change="onChange($event)" />
2021-02-25 20:48:59 +05:30
<br />
<label for="chkSkipPreview"><strong v-t="'actions.skip_preview'" /></label>
<br />
<input id="chkSkipPreview" v-model="skipPreview" class="checkbox" type="checkbox" @change="onChange($event)" />
<br />
<label for="chkSkipInteraction"><strong v-t="'actions.skip_interaction'" /></label>
2021-02-25 20:48:59 +05:30
<br />
<input
id="chkSkipInteraction"
v-model="skipInteraction"
class="checkbox"
type="checkbox"
@change="onChange($event)"
/>
2021-02-25 20:48:59 +05:30
<br />
<label for="chkSkipSelfPromo"><strong v-t="'actions.skip_self_promo'" /></label>
2021-02-25 20:48:59 +05:30
<br />
<input id="chkSkipSelfPromo" v-model="skipSelfPromo" class="checkbox" type="checkbox" @change="onChange($event)" />
2021-02-25 20:48:59 +05:30
<br />
<label for="chkSkipNonMusic"><strong v-t="'actions.skip_non_music'" /></label>
2021-02-25 20:48:59 +05:30
<br />
<input
id="chkSkipNonMusic"
v-model="skipMusicOffTopic"
class="checkbox"
type="checkbox"
@change="onChange($event)"
/>
<br />
<label for="chkSkipHighlight"><strong v-t="'actions.skip_highlight'" /></label>
<br />
<input id="chkSkipHighlight" v-model="skipHighlight" class="checkbox" type="checkbox" @change="onChange($event)" />
<br />
<label for="chkSkipFiller"><strong v-t="'actions.skip_filler_tangent'" /></label>
<br />
<input id="chkSkipFiller" v-model="skipFiller" class="checkbox" type="checkbox" @change="onChange($event)" />
<br />
<label for="ddlTheme"><strong v-t="'actions.theme'" /></label>
<br />
2021-12-27 20:16:29 +05:30
<select id="ddlTheme" v-model="selectedTheme" class="select w-auto" @change="onChange($event)">
<option v-t="'actions.auto'" value="auto" />
<option v-t="'actions.dark'" value="dark" />
<option v-t="'actions.light'" value="light" />
</select>
<br />
<label for="chkAutoPlayVideo"><strong v-t="'actions.autoplay_video'" /></label>
<br />
<input id="chkAutoPlayVideo" v-model="autoPlayVideo" class="checkbox" type="checkbox" @change="onChange($event)" />
2021-06-08 02:05:45 +05:30
<br />
<label for="chkAudioOnly"><strong v-t="'actions.audio_only'" /></label>
2021-06-08 02:05:45 +05:30
<br />
<input id="chkAudioOnly" v-model="listen" class="checkbox" type="checkbox" @change="onChange($event)" />
2021-06-22 01:33:11 +05:30
<br />
<label for="ddlDefaultQuality"><strong v-t="'actions.default_quality'" /></label>
2021-06-22 01:33:11 +05:30
<br />
2021-12-27 20:16:29 +05:30
<select id="ddlDefaultQuality" v-model="defaultQuality" class="select w-auto" @change="onChange($event)">
<option v-t="'actions.auto'" value="0" />
2021-12-27 21:59:25 +05:30
<option v-for="resolution in resolutions" :key="resolution" :value="resolution" v-text="`${resolution}p`" />
2021-06-22 01:33:11 +05:30
</select>
2021-06-22 16:24:20 +05:30
<br />
<label for="txtBufferingGoal"><strong v-t="'actions.buffering_goal'" /></label>
2021-06-22 16:24:20 +05:30
<br />
2021-12-27 20:16:29 +05:30
<input id="txtBufferingGoal" v-model="bufferingGoal" class="input w-auto" type="text" @change="onChange($event)" />
<br />
<label for="ddlCountrySelection"><strong v-t="'actions.country_selection'" /></label>
<br />
2021-12-27 20:16:29 +05:30
<select id="ddlCountrySelection" v-model="countrySelected" class="select w-auto" @change="onChange($event)">
2021-12-27 21:59:25 +05:30
<option v-for="country in countryMap" :key="country.code" :value="country.code" v-text="country.name" />
</select>
<br />
<label for="ddlDefaultHomepage"><strong v-t="'actions.default_homepage'" /></label>
<br />
2021-12-27 20:16:29 +05:30
<select id="ddlDefaultHomepage" v-model="defaultHomepage" class="select w-auto" @change="onChange($event)">
<option v-t="'titles.trending'" value="trending" />
<option v-t="'titles.feed'" value="feed" />
</select>
<br />
<label for="chkShowComments"><strong v-t="'actions.show_comments'" /></label>
<br />
<input id="chkShowComments" v-model="showComments" class="checkbox" type="checkbox" @change="onChange($event)" />
<br />
<label for="chkMinimizeDescription"><strong v-t="'actions.minimize_description_default'" /></label>
<br />
<input
id="chkMinimizeDescription"
v-model="minimizeDescription"
class="checkbox"
type="checkbox"
@change="onChange($event)"
/>
<br />
<label for="chkStoreWatchHistory"><strong v-t="'actions.store_watch_history'" /></label>
<br />
<input
id="chkStoreWatchHistory"
v-model="watchHistory"
class="checkbox"
type="checkbox"
@change="onChange($event)"
/>
<br />
<label for="ddlLanguageSelection"><strong v-t="'actions.language_selection'" /></label>
<br />
2021-12-27 20:16:29 +05:30
<select id="ddlLanguageSelection" v-model="selectedLanguage" class="select w-auto" @change="onChange($event)">
2021-12-27 21:59:25 +05:30
<option v-for="language in languages" :key="language.code" :value="language.code" v-text="language.name" />
</select>
<br />
<label for="ddlEnabledCodecs"><strong v-t="'actions.enabled_codecs'" /></label>
<br />
2021-12-27 20:16:29 +05:30
<select id="ddlEnabledCodecs" v-model="enabledCodecs" class="select w-auto" multiple @change="onChange($event)">
<option value="av1">AV1</option>
<option value="vp9">VP9</option>
<option value="avc">AVC (h.264)</option>
</select>
<br />
<label for="chkDisableLBRY"><strong v-t="'actions.disable_lbry'" /></label>
<br />
<input id="chkDisableLBRY" v-model="disableLBRY" class="checkbox" type="checkbox" @change="onChange($event)" />
<br />
<label for="chkEnableLBRYProxy"><strong v-t="'actions.enable_lbry_proxy'" /></label>
<br />
<input id="chkEnableLBRYProxy" v-model="proxyLBRY" class="checkbox" type="checkbox" @change="onChange($event)" />
2021-08-26 01:25:30 +05:30
<h2 v-t="'actions.instances_list'" />
<table class="table">
2020-11-17 10:45:35 +05:30
<thead>
<tr>
2021-12-27 21:59:25 +05:30
<th v-text="$t('preferences.instance_name')" />
<th v-text="$t('preferences.instance_locations')" />
<th v-text="$t('preferences.has_cdn')" />
<th v-text="$t('preferences.ssl_score')" />
2020-11-17 10:45:35 +05:30
</tr>
</thead>
<tbody v-for="instance in instances" :key="instance.name">
2020-11-17 10:45:35 +05:30
<tr>
2021-12-27 21:59:25 +05:30
<td v-text="instance.name" />
<td v-text="instance.locations" />
<td v-text="$t(`actions.${instance.cdn === 'Yes' ? 'yes' : 'no'}`)" />
2020-11-30 12:09:40 +05:30
<td>
2021-12-27 21:59:25 +05:30
<a :href="sslScore(instance.apiurl)" target="_blank" v-text="$t('actions.view_ssl_score')" />
2020-11-30 12:09:40 +05:30
</td>
2020-11-17 10:45:35 +05:30
</tr>
</tbody>
</table>
2020-11-22 10:04:27 +05:30
<hr />
2021-12-27 21:59:25 +05:30
<label for="ddlInstanceSelection"><strong v-text="`${$t('actions.instance_selection')}:`" /></label>
<br />
2021-12-27 20:16:29 +05:30
<select id="ddlInstanceSelection" v-model="selectedInstance" class="select w-auto" @change="onChange($event)">
2021-12-27 21:59:25 +05:30
<option v-for="instance in instances" :key="instance.name" :value="instance.apiurl" v-text="instance.name" />
2020-11-17 10:45:35 +05:30
</select>
</template>
<script>
import CountryMap from "@/utils/CountryMaps/en.json";
2020-11-17 10:45:35 +05:30
export default {
data() {
return {
selectedInstance: null,
2021-02-25 20:10:40 +05:30
instances: [],
2021-02-25 20:48:59 +05:30
sponsorBlock: true,
skipSponsor: true,
skipIntro: false,
skipOutro: false,
skipPreview: false,
2021-02-25 20:48:59 +05:30
skipInteraction: true,
skipSelfPromo: true,
skipMusicOffTopic: true,
skipHighlight: false,
skipFiller: false,
selectedTheme: "dark",
autoPlayVideo: true,
listen: false,
resolutions: [144, 240, 360, 480, 720, 1080, 1440, 2160, 4320],
2021-06-22 01:33:11 +05:30
defaultQuality: 0,
2021-06-22 16:24:20 +05:30
bufferingGoal: 10,
countryMap: CountryMap,
countrySelected: "US",
defaultHomepage: "trending",
showComments: true,
minimizeDescription: false,
watchHistory: false,
selectedLanguage: "en",
languages: [
2021-09-06 12:38:15 +05:30
{ code: "bn", name: "বাংলা" },
{ code: "cs", name: "Čeština" },
2021-09-06 12:38:15 +05:30
{ code: "de", name: "Deutsch" },
{ code: "el", name: "Ελληνικά" },
{ code: "es", name: "Español" },
{ code: "en", name: "English" },
{ code: "fa", name: "فارسی" },
Translations update from Weblate (#475) * Added translation using Weblate (Chinese (Simplified)) * Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (64 of 64 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/zh_Hans/ * Added translation using Weblate (Basque) * Translated using Weblate (Basque) Currently translated at 100.0% (64 of 64 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/eu/ * Added translation using Weblate (Finnish) * Translated using Weblate (French) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/fr/ * Translated using Weblate (German) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/de/ * Translated using Weblate (Italian) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/it/ * Translated using Weblate (Spanish) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/es/ * Translated using Weblate (Finnish) Currently translated at 74.2% (52 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/fi/ * Translated using Weblate (Lithuanian) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/lt/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/zh_Hans/ * Translated using Weblate (Turkish) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/tr/ * Translated using Weblate (Croatian) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/hr/ * Translated using Weblate (Basque) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/eu/ * Add support for Finnish and Chinese Simplified. Co-authored-by: Xie Yanbo <xieyanbo@gmail.com> Co-authored-by: Sergio Varela <sergitroll9@gmail.com> Co-authored-by: J. Lavoie <j.lavoie@net-c.ca> Co-authored-by: Gediminas Murauskas <muziejusinfo@gmail.com> Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com> Co-authored-by: Milo Ivir <mail@milotype.de> Co-authored-by: FireMasterK <20838718+FireMasterK@users.noreply.github.com>
2021-09-24 04:07:40 +05:30
{ code: "fi", name: "Suomi" },
{ code: "fr", name: "français" },
{ code: "id", name: "Indonesia" },
{ code: "is", name: "Íslenska" },
2021-09-16 23:59:48 +05:30
{ code: "hr", name: "Hrvatski" },
{ code: "it", name: "italiano" },
{ code: "ja", name: "日本語" },
{ code: "ko", name: "한국어" },
2021-09-06 12:38:15 +05:30
{ code: "lt", name: "lietuvių kalba" },
{ code: "ml", name: "മലയാളം" },
Translations update from Weblate (#384) * Added translation using Weblate (German) * Added translation using Weblate (Norwegian Bokmål) * Added translation using Weblate (Chinese (Traditional)) * Translated using Weblate (Norwegian Bokmål) Currently translated at 82.5% (33 of 40 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/nb_NO/ * Added translation using Weblate (Malayalam) * Translated using Weblate (French) Currently translated at 100.0% (40 of 40 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/fr/ * Translated using Weblate (French) Currently translated at 100.0% (40 of 40 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/fr/ * Translated using Weblate (German) Currently translated at 100.0% (40 of 40 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/de/ * Translated using Weblate (Chinese (Traditional)) Currently translated at 42.5% (17 of 40 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/zh_Hant/ * Translated using Weblate (Malayalam) Currently translated at 90.0% (36 of 40 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/ml/ * Add support for 4 new languages. Co-authored-by: J. Lavoie <j.lavoie@net-c.ca> Co-authored-by: Allan Nordhøy <epost@anotheragency.no> Co-authored-by: Jamugha <hackdown@necord.com> Co-authored-by: vachan-maker <vachan2014carmel@gmail.com> Co-authored-by: FireMasterK <20838718+FireMasterK@users.noreply.github.com>
2021-08-26 17:18:23 +05:30
{ code: "nb_NO", name: "Norwegian Bokmål" },
2021-09-16 23:59:48 +05:30
{ code: "pl", name: "polski" },
{ code: "pt", name: "Português" },
{ code: "ru", name: "русский" },
2021-11-25 01:01:39 +05:30
{ code: "sr", name: "Српски" },
{ code: "sv", name: "svenska" },
2021-09-06 12:38:15 +05:30
{ code: "tr", name: "Türkçe" },
{ code: "uk", name: "українська" },
2021-09-16 23:59:48 +05:30
{ code: "zh_Hant", name: "繁體中文" },
Translations update from Weblate (#475) * Added translation using Weblate (Chinese (Simplified)) * Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (64 of 64 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/zh_Hans/ * Added translation using Weblate (Basque) * Translated using Weblate (Basque) Currently translated at 100.0% (64 of 64 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/eu/ * Added translation using Weblate (Finnish) * Translated using Weblate (French) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/fr/ * Translated using Weblate (German) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/de/ * Translated using Weblate (Italian) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/it/ * Translated using Weblate (Spanish) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/es/ * Translated using Weblate (Finnish) Currently translated at 74.2% (52 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/fi/ * Translated using Weblate (Lithuanian) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/lt/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/zh_Hans/ * Translated using Weblate (Turkish) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/tr/ * Translated using Weblate (Croatian) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/hr/ * Translated using Weblate (Basque) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/eu/ * Add support for Finnish and Chinese Simplified. Co-authored-by: Xie Yanbo <xieyanbo@gmail.com> Co-authored-by: Sergio Varela <sergitroll9@gmail.com> Co-authored-by: J. Lavoie <j.lavoie@net-c.ca> Co-authored-by: Gediminas Murauskas <muziejusinfo@gmail.com> Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com> Co-authored-by: Milo Ivir <mail@milotype.de> Co-authored-by: FireMasterK <20838718+FireMasterK@users.noreply.github.com>
2021-09-24 04:07:40 +05:30
{ code: "zh_Hans", name: "简体中文" },
],
enabledCodecs: ["av1", "vp9", "avc"],
disableLBRY: false,
proxyLBRY: false,
2020-11-17 10:45:35 +05:30
};
},
activated() {
document.title = this.$t("titles.preferences") + " - Piped";
},
async mounted() {
if (Object.keys(this.$route.query).length > 0) this.$router.replace({ query: {} });
fetch("https://raw.githubusercontent.com/wiki/TeamPiped/Piped-Frontend/Instances.md")
2020-11-17 10:45:35 +05:30
.then(resp => resp.text())
.then(body => {
var skipped = 0;
const lines = body.split("\n");
lines.map(line => {
const split = line.split("|");
if (split.length == 5) {
2020-11-17 10:45:35 +05:30
if (skipped < 2) {
skipped++;
return;
}
this.instances.push({
name: split[0].trim(),
apiurl: split[1].trim(),
locations: split[2].trim(),
cdn: split[3].trim(),
2020-11-17 10:45:35 +05:30
});
}
});
2021-08-26 01:25:30 +05:30
if (this.instances.filter(instance => instance.apiurl == this.apiUrl()).length == 0)
this.instances.push({
name: "Custom Instance",
apiurl: this.apiUrl(),
locations: "Unknown",
cdn: "Unknown",
});
2020-11-17 10:45:35 +05:30
});
if (this.testLocalStorage) {
this.selectedInstance = this.getPreferenceString("instance", "https://pipedapi.kavin.rocks");
2021-02-25 20:10:40 +05:30
this.sponsorBlock = this.getPreferenceBoolean("sponsorblock", true);
2021-04-21 19:08:50 +05:30
if (localStorage.getItem("selectedSkip") !== null) {
2021-02-25 20:48:59 +05:30
var skipList = localStorage.getItem("selectedSkip").split(",");
this.skipSponsor =
this.skipIntro =
this.skipOutro =
this.skipPreview =
this.skipInteraction =
this.skipSelfPromo =
this.skipMusicOffTopic =
this.skipHighlight =
this.skipFiller =
false;
2021-02-25 20:48:59 +05:30
skipList.forEach(skip => {
switch (skip) {
case "sponsor":
this.skipSponsor = true;
break;
case "intro":
this.skipIntro = true;
break;
case "outro":
this.skipOutro = true;
break;
case "preview":
this.skipPreview = true;
break;
2021-02-25 20:48:59 +05:30
case "interaction":
this.skipInteraction = true;
break;
case "selfpromo":
this.skipSelfPromo = true;
break;
case "music_offtopic":
this.skipMusicOffTopic = true;
break;
case "poi_highlight":
this.skipHighlight = true;
break;
case "filler":
this.skipFiller = true;
break;
2021-02-25 20:48:59 +05:30
default:
console.log("Unknown sponsor type: " + skip);
break;
}
});
}
this.selectedTheme = this.getPreferenceString("theme", "dark");
this.autoPlayVideo = this.getPreferenceBoolean("playerAutoPlay", true);
this.listen = this.getPreferenceBoolean("listen", false);
2021-06-22 01:33:11 +05:30
this.defaultQuality = Number(localStorage.getItem("quality"));
2021-06-22 16:24:20 +05:30
this.bufferingGoal = Math.max(Number(localStorage.getItem("bufferGoal")), 10);
this.countrySelected = this.getPreferenceString("region", "US");
this.defaultHomepage = this.getPreferenceString("homepage", "trending");
this.showComments = this.getPreferenceBoolean("comments", true);
this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false);
this.watchHistory = this.getPreferenceBoolean("watchHistory", false);
2021-09-24 04:27:26 +05:30
this.selectedLanguage = this.getPreferenceString("hl", this.defaultLangage);
this.enabledCodecs = this.getPreferenceString("enabledCodecs", "av1,vp9,avc").split(",");
this.disableLBRY = this.getPreferenceBoolean("disableLBRY", false);
this.proxyLBRY = this.getPreferenceBoolean("proxyLBRY", false);
if (this.selectedLanguage != "en") {
try {
2021-12-28 20:09:20 +05:30
this.CountryMap = await import(`../utils/CountryMaps/${this.selectedLanguage}.json`).then(
val => val.default,
Translations update from Weblate (#475) * Added translation using Weblate (Chinese (Simplified)) * Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (64 of 64 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/zh_Hans/ * Added translation using Weblate (Basque) * Translated using Weblate (Basque) Currently translated at 100.0% (64 of 64 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/eu/ * Added translation using Weblate (Finnish) * Translated using Weblate (French) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/fr/ * Translated using Weblate (German) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/de/ * Translated using Weblate (Italian) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/it/ * Translated using Weblate (Spanish) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/es/ * Translated using Weblate (Finnish) Currently translated at 74.2% (52 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/fi/ * Translated using Weblate (Lithuanian) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/lt/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/zh_Hans/ * Translated using Weblate (Turkish) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/tr/ * Translated using Weblate (Croatian) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/hr/ * Translated using Weblate (Basque) Currently translated at 100.0% (70 of 70 strings) Translation: Piped/Frontend Translate-URL: https://hosted.weblate.org/projects/piped/frontend/eu/ * Add support for Finnish and Chinese Simplified. Co-authored-by: Xie Yanbo <xieyanbo@gmail.com> Co-authored-by: Sergio Varela <sergitroll9@gmail.com> Co-authored-by: J. Lavoie <j.lavoie@net-c.ca> Co-authored-by: Gediminas Murauskas <muziejusinfo@gmail.com> Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com> Co-authored-by: Milo Ivir <mail@milotype.de> Co-authored-by: FireMasterK <20838718+FireMasterK@users.noreply.github.com>
2021-09-24 04:07:40 +05:30
);
} catch (e) {
console.error("Countries not translated into " + this.selectedLanguage);
}
}
2021-02-25 20:10:40 +05:30
}
2020-11-17 10:45:35 +05:30
},
methods: {
onChange() {
if (this.testLocalStorage) {
var shouldReload = false;
if (
this.getPreferenceString("theme", "dark") !== this.selectedTheme ||
this.getPreferenceBoolean("watchHistory", false) != this.watchHistory ||
2021-09-24 04:27:26 +05:30
this.getPreferenceString("hl", this.defaultLangage) !== this.selectedLanguage ||
this.getPreferenceString("enabledCodecs", "av1,vp9,avc") !== this.enabledCodecs.join(",")
)
shouldReload = true;
2020-11-17 10:45:35 +05:30
localStorage.setItem("instance", this.selectedInstance);
2021-02-25 20:10:40 +05:30
localStorage.setItem("sponsorblock", this.sponsorBlock);
2021-02-25 20:48:59 +05:30
var sponsorSelected = [];
if (this.skipSponsor) sponsorSelected.push("sponsor");
if (this.skipIntro) sponsorSelected.push("intro");
if (this.skipOutro) sponsorSelected.push("outro");
if (this.skipPreview) sponsorSelected.push("preview");
2021-02-25 20:48:59 +05:30
if (this.skipInteraction) sponsorSelected.push("interaction");
if (this.skipSelfPromo) sponsorSelected.push("selfpromo");
if (this.skipMusicOffTopic) sponsorSelected.push("music_offtopic");
if (this.skipHighlight) sponsorSelected.push("poi_highlight");
if (this.skipFiller) sponsorSelected.push("filler");
2021-02-25 20:48:59 +05:30
localStorage.setItem("selectedSkip", sponsorSelected);
localStorage.setItem("theme", this.selectedTheme);
localStorage.setItem("playerAutoPlay", this.autoPlayVideo);
localStorage.setItem("listen", this.listen);
2021-06-22 01:33:11 +05:30
localStorage.setItem("quality", this.defaultQuality);
2021-06-22 16:24:20 +05:30
localStorage.setItem("bufferGoal", this.bufferingGoal);
localStorage.setItem("region", this.countrySelected);
localStorage.setItem("homepage", this.defaultHomepage);
localStorage.setItem("comments", this.showComments);
localStorage.setItem("minimizeDescription", this.minimizeDescription);
localStorage.setItem("watchHistory", this.watchHistory);
localStorage.setItem("hl", this.selectedLanguage);
localStorage.setItem("enabledCodecs", this.enabledCodecs.join(","));
localStorage.setItem("disableLBRY", this.disableLBRY);
localStorage.setItem("proxyLBRY", this.proxyLBRY);
if (shouldReload) window.location.reload();
2021-02-25 20:10:40 +05:30
}
2020-11-30 12:09:40 +05:30
},
sslScore(url) {
return "https://www.ssllabs.com/ssltest/analyze.html?d=" + new URL(url).host + "&latest";
},
},
2020-11-17 10:45:35 +05:30
};
</script>