2020-11-17 05:15:35 +00:00
|
|
|
<template>
|
2022-01-12 11:27:08 +00:00
|
|
|
<div class="flex">
|
|
|
|
<button @click="$router.go(-1) || $router.push('/')">
|
2022-01-30 23:48:27 +00:00
|
|
|
<font-awesome-icon icon="chevron-left" /><span class="ml-1.5" v-t="'actions.back'" />
|
2021-08-22 10:27:09 +00:00
|
|
|
</button>
|
2021-07-20 14:45:17 +00:00
|
|
|
</div>
|
2022-01-12 11:27:08 +00:00
|
|
|
<h1 v-t="'titles.preferences'" class="font-bold text-center" />
|
2020-11-22 04:34:27 +00:00
|
|
|
<hr />
|
2021-02-25 14:40:40 +00:00
|
|
|
<h2>SponsorBlock</h2>
|
2022-01-30 23:48:27 +00:00
|
|
|
<p><span v-t="'actions.uses_api_from'" /><a class="link" href="https://sponsor.ajay.app/">sponsor.ajay.app</a></p>
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkEnableSponsorblock"><strong v-t="'actions.enable_sponsorblock'" /></label>
|
2021-02-25 14:40:40 +00:00
|
|
|
<br />
|
2021-09-16 18:19:37 +00:00
|
|
|
<input
|
|
|
|
id="chkEnableSponsorblock"
|
|
|
|
v-model="sponsorBlock"
|
2022-01-12 11:27:08 +00:00
|
|
|
class="checkbox"
|
2021-09-16 18:19:37 +00:00
|
|
|
type="checkbox"
|
2021-10-08 18:52:51 +00:00
|
|
|
@change="onChange($event)"
|
2021-09-16 18:19:37 +00:00
|
|
|
/>
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkSkipSponsors"><strong v-t="'actions.skip_sponsors'" /></label>
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkSkipSponsors" v-model="skipSponsor" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkSkipIntro"><strong v-t="'actions.skip_intro'" /></label>
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkSkipIntro" v-model="skipIntro" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkSkipOutro"><strong v-t="'actions.skip_outro'" /></label>
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkSkipOutro" v-model="skipOutro" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkSkipPreview"><strong v-t="'actions.skip_preview'" /></label>
|
2021-07-18 19:53:17 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkSkipPreview" v-model="skipPreview" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-07-18 19:53:17 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkSkipInteraction"><strong v-t="'actions.skip_interaction'" /></label>
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2021-09-16 18:19:37 +00:00
|
|
|
<input
|
|
|
|
id="chkSkipInteraction"
|
|
|
|
v-model="skipInteraction"
|
2022-01-12 11:27:08 +00:00
|
|
|
class="checkbox"
|
2021-09-16 18:19:37 +00:00
|
|
|
type="checkbox"
|
2021-10-08 18:52:51 +00:00
|
|
|
@change="onChange($event)"
|
2021-09-16 18:19:37 +00:00
|
|
|
/>
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkSkipSelfPromo"><strong v-t="'actions.skip_self_promo'" /></label>
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkSkipSelfPromo" v-model="skipSelfPromo" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkSkipNonMusic"><strong v-t="'actions.skip_non_music'" /></label>
|
2021-02-25 15:18:59 +00:00
|
|
|
<br />
|
2021-09-16 18:19:37 +00:00
|
|
|
<input
|
|
|
|
id="chkSkipNonMusic"
|
|
|
|
v-model="skipMusicOffTopic"
|
2022-01-12 11:27:08 +00:00
|
|
|
class="checkbox"
|
2021-09-16 18:19:37 +00:00
|
|
|
type="checkbox"
|
2021-10-08 18:52:51 +00:00
|
|
|
@change="onChange($event)"
|
2021-09-16 18:19:37 +00:00
|
|
|
/>
|
2021-05-06 17:30:02 +00:00
|
|
|
<br />
|
2022-01-13 09:42:21 +00:00
|
|
|
<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 />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="ddlTheme"><strong v-t="'actions.theme'" /></label>
|
2021-06-28 19:45:03 +00:00
|
|
|
<br />
|
2021-12-27 14:46:29 +00:00
|
|
|
<select id="ddlTheme" v-model="selectedTheme" class="select w-auto" @change="onChange($event)">
|
2021-10-08 18:52:51 +00:00
|
|
|
<option v-t="'actions.auto'" value="auto" />
|
|
|
|
<option v-t="'actions.dark'" value="dark" />
|
|
|
|
<option v-t="'actions.light'" value="light" />
|
2021-06-28 19:45:03 +00:00
|
|
|
</select>
|
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkAutoPlayVideo"><strong v-t="'actions.autoplay_video'" /></label>
|
2021-05-06 17:30:02 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkAutoPlayVideo" v-model="autoPlayVideo" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-06-07 20:35:45 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkAudioOnly"><strong v-t="'actions.audio_only'" /></label>
|
2021-06-07 20:35:45 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkAudioOnly" v-model="listen" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-06-21 20:03:11 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="ddlDefaultQuality"><strong v-t="'actions.default_quality'" /></label>
|
2021-06-21 20:03:11 +00:00
|
|
|
<br />
|
2021-12-27 14:46:29 +00:00
|
|
|
<select id="ddlDefaultQuality" v-model="defaultQuality" class="select w-auto" @change="onChange($event)">
|
2021-10-08 18:52:51 +00:00
|
|
|
<option v-t="'actions.auto'" value="0" />
|
2021-12-27 16:29:25 +00:00
|
|
|
<option v-for="resolution in resolutions" :key="resolution" :value="resolution" v-text="`${resolution}p`" />
|
2021-06-21 20:03:11 +00:00
|
|
|
</select>
|
2021-06-22 10:54:20 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="txtBufferingGoal"><strong v-t="'actions.buffering_goal'" /></label>
|
2021-06-22 10:54:20 +00:00
|
|
|
<br />
|
2021-12-27 14:46:29 +00:00
|
|
|
<input id="txtBufferingGoal" v-model="bufferingGoal" class="input w-auto" type="text" @change="onChange($event)" />
|
2021-07-05 13:18:54 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="ddlCountrySelection"><strong v-t="'actions.country_selection'" /></label>
|
2021-07-05 13:18:54 +00:00
|
|
|
<br />
|
2021-12-27 14:46:29 +00:00
|
|
|
<select id="ddlCountrySelection" v-model="countrySelected" class="select w-auto" @change="onChange($event)">
|
2021-12-27 16:29:25 +00:00
|
|
|
<option v-for="country in countryMap" :key="country.code" :value="country.code" v-text="country.name" />
|
2021-07-05 13:18:54 +00:00
|
|
|
</select>
|
2021-07-18 20:20:35 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="ddlDefaultHomepage"><strong v-t="'actions.default_homepage'" /></label>
|
2021-07-18 20:20:35 +00:00
|
|
|
<br />
|
2021-12-27 14:46:29 +00:00
|
|
|
<select id="ddlDefaultHomepage" v-model="defaultHomepage" class="select w-auto" @change="onChange($event)">
|
2021-10-08 18:52:51 +00:00
|
|
|
<option v-t="'titles.trending'" value="trending" />
|
|
|
|
<option v-t="'titles.feed'" value="feed" />
|
2021-07-18 20:20:35 +00:00
|
|
|
</select>
|
2021-07-18 20:27:34 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkShowComments"><strong v-t="'actions.show_comments'" /></label>
|
2021-07-18 20:27:34 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkShowComments" v-model="showComments" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-07-30 09:03:16 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkMinimizeDescription"><strong v-t="'actions.minimize_description_default'" /></label>
|
2021-09-16 18:19:37 +00:00
|
|
|
<br />
|
|
|
|
<input
|
|
|
|
id="chkMinimizeDescription"
|
|
|
|
v-model="minimizeDescription"
|
2022-01-12 11:27:08 +00:00
|
|
|
class="checkbox"
|
2021-09-16 18:19:37 +00:00
|
|
|
type="checkbox"
|
2021-10-08 18:52:51 +00:00
|
|
|
@change="onChange($event)"
|
2021-09-16 18:19:37 +00:00
|
|
|
/>
|
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkStoreWatchHistory"><strong v-t="'actions.store_watch_history'" /></label>
|
2021-09-16 18:19:37 +00:00
|
|
|
<br />
|
|
|
|
<input
|
|
|
|
id="chkStoreWatchHistory"
|
|
|
|
v-model="watchHistory"
|
2022-01-12 11:27:08 +00:00
|
|
|
class="checkbox"
|
2021-09-16 18:19:37 +00:00
|
|
|
type="checkbox"
|
2021-10-08 18:52:51 +00:00
|
|
|
@change="onChange($event)"
|
2021-09-16 18:19:37 +00:00
|
|
|
/>
|
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="ddlLanguageSelection"><strong v-t="'actions.language_selection'" /></label>
|
2021-09-16 18:19:37 +00:00
|
|
|
<br />
|
2021-12-27 14:46:29 +00:00
|
|
|
<select id="ddlLanguageSelection" v-model="selectedLanguage" class="select w-auto" @change="onChange($event)">
|
2021-12-27 16:29:25 +00:00
|
|
|
<option v-for="language in languages" :key="language.code" :value="language.code" v-text="language.name" />
|
2021-08-25 16:30:21 +00:00
|
|
|
</select>
|
2021-08-27 07:33:55 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="ddlEnabledCodecs"><strong v-t="'actions.enabled_codecs'" /></label>
|
2021-08-27 07:33:55 +00:00
|
|
|
<br />
|
2021-12-27 14:46:29 +00:00
|
|
|
<select id="ddlEnabledCodecs" v-model="enabledCodecs" class="select w-auto" multiple @change="onChange($event)">
|
2021-08-27 07:33:55 +00:00
|
|
|
<option value="av1">AV1</option>
|
|
|
|
<option value="vp9">VP9</option>
|
|
|
|
<option value="avc">AVC (h.264)</option>
|
|
|
|
</select>
|
2021-09-02 13:46:27 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkDisableLBRY"><strong v-t="'actions.disable_lbry'" /></label>
|
2021-09-02 13:46:27 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkDisableLBRY" v-model="disableLBRY" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-09-02 13:46:27 +00:00
|
|
|
<br />
|
2021-12-27 14:43:37 +00:00
|
|
|
<label for="chkEnableLBRYProxy"><strong v-t="'actions.enable_lbry_proxy'" /></label>
|
2021-09-02 13:46:27 +00:00
|
|
|
<br />
|
2022-01-12 11:27:08 +00:00
|
|
|
<input id="chkEnableLBRYProxy" v-model="proxyLBRY" class="checkbox" type="checkbox" @change="onChange($event)" />
|
2021-08-25 19:55:30 +00:00
|
|
|
<h2 v-t="'actions.instances_list'" />
|
2022-01-12 11:27:08 +00:00
|
|
|
<table class="table">
|
2020-11-17 05:15:35 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-01-30 23:48:27 +00:00
|
|
|
<th v-t="'preferences.instance_name'" />
|
|
|
|
<th v-t="'preferences.instance_locations'" />
|
|
|
|
<th v-t="'preferences.has_cdn'" />
|
2022-02-23 12:38:21 +00:00
|
|
|
<th v-t="'preferences.registered_users'" />
|
|
|
|
<th v-t="'preferences.version'" />
|
|
|
|
<th v-t="'preferences.up_to_date'" />
|
2022-01-30 23:48:27 +00:00
|
|
|
<th v-t="'preferences.ssl_score'" />
|
2020-11-17 05:15:35 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2021-10-08 18:52:51 +00:00
|
|
|
<tbody v-for="instance in instances" :key="instance.name">
|
2020-11-17 05:15:35 +00:00
|
|
|
<tr>
|
2021-12-27 16:29:25 +00:00
|
|
|
<td v-text="instance.name" />
|
|
|
|
<td v-text="instance.locations" />
|
2022-02-23 12:38:21 +00:00
|
|
|
<td v-t="`actions.${instance.cdn ? 'yes' : 'no'}`" />
|
|
|
|
<td v-text="instance.registered" />
|
|
|
|
<td v-text="instance.version" />
|
|
|
|
<td v-t="`actions.${instance.up_to_date ? 'yes' : 'no'}`" />
|
2020-11-30 06:39:40 +00:00
|
|
|
<td>
|
2022-02-23 12:38:21 +00:00
|
|
|
<a :href="sslScore(instance.api_url)" target="_blank" v-t="'actions.view_ssl_score'" />
|
2020-11-30 06:39:40 +00:00
|
|
|
</td>
|
2020-11-17 05:15:35 +00:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2020-11-22 04:34:27 +00:00
|
|
|
<hr />
|
|
|
|
|
2021-12-27 16:29:25 +00:00
|
|
|
<label for="ddlInstanceSelection"><strong v-text="`${$t('actions.instance_selection')}:`" /></label>
|
2021-09-16 18:19:37 +00:00
|
|
|
<br />
|
2021-12-27 14:46:29 +00:00
|
|
|
<select id="ddlInstanceSelection" v-model="selectedInstance" class="select w-auto" @change="onChange($event)">
|
2022-02-23 12:38:21 +00:00
|
|
|
<option v-for="instance in instances" :key="instance.name" :value="instance.api_url" v-text="instance.name" />
|
2020-11-17 05:15:35 +00:00
|
|
|
</select>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-09-21 20:24:21 +00:00
|
|
|
import CountryMap from "@/utils/CountryMaps/en.json";
|
2020-11-17 05:15:35 +00:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
selectedInstance: null,
|
2021-02-25 14:40:40 +00:00
|
|
|
instances: [],
|
2021-02-25 15:18:59 +00:00
|
|
|
sponsorBlock: true,
|
|
|
|
skipSponsor: true,
|
|
|
|
skipIntro: false,
|
|
|
|
skipOutro: false,
|
2021-07-18 19:53:17 +00:00
|
|
|
skipPreview: false,
|
2021-02-25 15:18:59 +00:00
|
|
|
skipInteraction: true,
|
|
|
|
skipSelfPromo: true,
|
2021-04-07 11:45:40 +00:00
|
|
|
skipMusicOffTopic: true,
|
2022-01-13 09:42:21 +00:00
|
|
|
skipHighlight: false,
|
|
|
|
skipFiller: false,
|
2021-06-28 19:45:03 +00:00
|
|
|
selectedTheme: "dark",
|
2021-05-06 17:30:02 +00:00
|
|
|
autoPlayVideo: true,
|
2021-07-03 19:24:09 +00:00
|
|
|
listen: false,
|
2021-06-21 20:25:38 +00:00
|
|
|
resolutions: [144, 240, 360, 480, 720, 1080, 1440, 2160, 4320],
|
2021-06-21 20:03:11 +00:00
|
|
|
defaultQuality: 0,
|
2021-06-22 10:54:20 +00:00
|
|
|
bufferingGoal: 10,
|
2021-09-21 20:24:21 +00:00
|
|
|
countryMap: CountryMap,
|
2021-10-08 18:52:51 +00:00
|
|
|
countrySelected: "US",
|
2021-07-18 20:20:35 +00:00
|
|
|
defaultHomepage: "trending",
|
2021-07-18 20:27:34 +00:00
|
|
|
showComments: true,
|
2021-07-30 09:03:16 +00:00
|
|
|
minimizeDescription: false,
|
2021-08-22 10:27:09 +00:00
|
|
|
watchHistory: false,
|
2021-08-25 16:30:21 +00:00
|
|
|
selectedLanguage: "en",
|
|
|
|
languages: [
|
2021-09-06 07:08:15 +00:00
|
|
|
{ code: "bn", name: "বাংলা" },
|
2022-04-09 00:08:54 +00:00
|
|
|
{ code: "bs", name: "Bosanski" },
|
2022-02-15 10:57:37 +00:00
|
|
|
{ code: "ca", name: "Català" },
|
2021-12-27 11:15:23 +00:00
|
|
|
{ code: "cs", name: "Čeština" },
|
2022-03-20 18:36:05 +00:00
|
|
|
{ code: "da", name: "Dansk" },
|
2021-09-06 07:08:15 +00:00
|
|
|
{ code: "de", name: "Deutsch" },
|
|
|
|
{ code: "el", name: "Ελληνικά" },
|
2021-09-16 18:19:37 +00:00
|
|
|
{ code: "es", name: "Español" },
|
|
|
|
{ code: "en", name: "English" },
|
2022-02-15 10:57:37 +00:00
|
|
|
{ code: "eo", name: "Esperanto" },
|
2021-09-16 18:19:37 +00:00
|
|
|
{ code: "fa", name: "فارسی" },
|
2021-09-23 22:37:40 +00:00
|
|
|
{ code: "fi", name: "Suomi" },
|
2022-03-14 14:58:05 +00:00
|
|
|
{ code: "fr", name: "Français" },
|
2022-01-16 08:42:01 +00:00
|
|
|
{ code: "hi", name: "हिंदी" },
|
2021-12-09 14:43:53 +00:00
|
|
|
{ code: "id", name: "Indonesia" },
|
|
|
|
{ code: "is", name: "Íslenska" },
|
2021-09-16 18:29:48 +00:00
|
|
|
{ code: "hr", name: "Hrvatski" },
|
2022-03-14 14:58:05 +00:00
|
|
|
{ code: "it", name: "Italiano" },
|
2021-11-12 14:01:07 +00:00
|
|
|
{ code: "ja", name: "日本語" },
|
2021-12-24 10:47:32 +00:00
|
|
|
{ code: "ko", name: "한국어" },
|
2022-03-14 14:58:05 +00:00
|
|
|
{ code: "lt", name: "Lietuvių kalba" },
|
2021-09-06 07:08:15 +00:00
|
|
|
{ code: "ml", name: "മലയാളം" },
|
2021-08-26 11:48:23 +00:00
|
|
|
{ code: "nb_NO", name: "Norwegian Bokmål" },
|
2022-04-09 00:08:54 +00:00
|
|
|
{ code: "nl", name: "Nederlands" },
|
2022-03-14 14:58:05 +00:00
|
|
|
{ code: "pl", name: "Polski" },
|
2021-12-24 10:47:32 +00:00
|
|
|
{ code: "pt", name: "Português" },
|
2022-03-14 15:01:01 +00:00
|
|
|
{ code: "pt_PT", name: "Português (Portugal)" },
|
2022-03-14 14:58:05 +00:00
|
|
|
{ code: "ru", name: "Русский" },
|
2021-11-24 19:31:39 +00:00
|
|
|
{ code: "sr", name: "Српски" },
|
2022-03-14 14:58:05 +00:00
|
|
|
{ code: "sv", name: "Svenska" },
|
2022-01-16 08:42:01 +00:00
|
|
|
{ code: "ta", name: "தமிழ்" },
|
2022-01-19 20:51:31 +00:00
|
|
|
{ code: "th", name: "ไทย" },
|
2021-09-06 07:08:15 +00:00
|
|
|
{ code: "tr", name: "Türkçe" },
|
2022-03-14 14:58:05 +00:00
|
|
|
{ code: "uk", name: "Українська" },
|
2022-04-07 02:34:48 +00:00
|
|
|
{ code: "vi", name: "Tiếng Việt" },
|
2021-09-16 18:29:48 +00:00
|
|
|
{ code: "zh_Hant", name: "繁體中文" },
|
2021-09-23 22:37:40 +00:00
|
|
|
{ code: "zh_Hans", name: "简体中文" },
|
2021-08-25 16:30:21 +00:00
|
|
|
],
|
2021-08-27 07:33:55 +00:00
|
|
|
enabledCodecs: ["av1", "vp9", "avc"],
|
2021-09-02 13:46:27 +00:00
|
|
|
disableLBRY: false,
|
|
|
|
proxyLBRY: false,
|
2020-11-17 05:15:35 +00:00
|
|
|
};
|
|
|
|
},
|
2021-07-21 10:59:53 +00:00
|
|
|
activated() {
|
2021-08-25 16:30:21 +00:00
|
|
|
document.title = this.$t("titles.preferences") + " - Piped";
|
2021-07-21 10:59:53 +00:00
|
|
|
},
|
2021-09-21 20:24:21 +00:00
|
|
|
async mounted() {
|
2021-07-03 19:24:09 +00:00
|
|
|
if (Object.keys(this.$route.query).length > 0) this.$router.replace({ query: {} });
|
|
|
|
|
2022-02-23 12:38:21 +00:00
|
|
|
this.fetchJson("https://piped-instances.kavin.rocks/").then(resp => {
|
|
|
|
this.instances = resp;
|
|
|
|
if (this.instances.filter(instance => instance.api_url == this.apiUrl()).length == 0)
|
|
|
|
this.instances.push({
|
|
|
|
name: "Custom Instance",
|
|
|
|
api_url: this.apiUrl(),
|
|
|
|
locations: "Unknown",
|
|
|
|
cdn: false,
|
2020-11-17 05:15:35 +00:00
|
|
|
});
|
2022-02-23 12:38:21 +00:00
|
|
|
});
|
2020-11-17 05:15:35 +00:00
|
|
|
|
2021-08-28 12:00:17 +00:00
|
|
|
if (this.testLocalStorage) {
|
2021-07-05 13:18:54 +00:00
|
|
|
this.selectedInstance = this.getPreferenceString("instance", "https://pipedapi.kavin.rocks");
|
2021-02-25 14:40:40 +00:00
|
|
|
|
2021-07-03 19:24:09 +00:00
|
|
|
this.sponsorBlock = this.getPreferenceBoolean("sponsorblock", true);
|
2021-04-21 13:38:50 +00:00
|
|
|
if (localStorage.getItem("selectedSkip") !== null) {
|
2021-02-25 15:18:59 +00:00
|
|
|
var skipList = localStorage.getItem("selectedSkip").split(",");
|
2021-12-27 14:43:37 +00:00
|
|
|
this.skipSponsor =
|
|
|
|
this.skipIntro =
|
|
|
|
this.skipOutro =
|
|
|
|
this.skipPreview =
|
|
|
|
this.skipInteraction =
|
|
|
|
this.skipSelfPromo =
|
|
|
|
this.skipMusicOffTopic =
|
2022-01-13 09:42:21 +00:00
|
|
|
this.skipHighlight =
|
|
|
|
this.skipFiller =
|
2021-12-27 14:43:37 +00:00
|
|
|
false;
|
2021-02-25 15:18:59 +00:00
|
|
|
skipList.forEach(skip => {
|
|
|
|
switch (skip) {
|
|
|
|
case "sponsor":
|
|
|
|
this.skipSponsor = true;
|
|
|
|
break;
|
|
|
|
case "intro":
|
|
|
|
this.skipIntro = true;
|
|
|
|
break;
|
|
|
|
case "outro":
|
|
|
|
this.skipOutro = true;
|
|
|
|
break;
|
2021-07-18 19:53:17 +00:00
|
|
|
case "preview":
|
|
|
|
this.skipPreview = true;
|
|
|
|
break;
|
2021-02-25 15:18:59 +00:00
|
|
|
case "interaction":
|
|
|
|
this.skipInteraction = true;
|
|
|
|
break;
|
|
|
|
case "selfpromo":
|
|
|
|
this.skipSelfPromo = true;
|
|
|
|
break;
|
|
|
|
case "music_offtopic":
|
|
|
|
this.skipMusicOffTopic = true;
|
|
|
|
break;
|
2022-01-13 09:42:21 +00:00
|
|
|
case "poi_highlight":
|
|
|
|
this.skipHighlight = true;
|
|
|
|
break;
|
|
|
|
case "filler":
|
|
|
|
this.skipFiller = true;
|
|
|
|
break;
|
2021-02-25 15:18:59 +00:00
|
|
|
default:
|
|
|
|
console.log("Unknown sponsor type: " + skip);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2021-05-06 17:30:02 +00:00
|
|
|
|
2021-07-03 19:24:09 +00:00
|
|
|
this.selectedTheme = this.getPreferenceString("theme", "dark");
|
2021-09-17 20:34:51 +00:00
|
|
|
this.autoPlayVideo = this.getPreferenceBoolean("playerAutoPlay", true);
|
2021-07-03 19:24:09 +00:00
|
|
|
this.listen = this.getPreferenceBoolean("listen", false);
|
2021-06-21 20:03:11 +00:00
|
|
|
this.defaultQuality = Number(localStorage.getItem("quality"));
|
2021-06-22 10:54:20 +00:00
|
|
|
this.bufferingGoal = Math.max(Number(localStorage.getItem("bufferGoal")), 10);
|
2021-10-08 18:52:51 +00:00
|
|
|
this.countrySelected = this.getPreferenceString("region", "US");
|
2021-07-18 20:20:35 +00:00
|
|
|
this.defaultHomepage = this.getPreferenceString("homepage", "trending");
|
2021-07-18 20:27:34 +00:00
|
|
|
this.showComments = this.getPreferenceBoolean("comments", true);
|
2021-07-30 09:03:16 +00:00
|
|
|
this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false);
|
2021-08-22 10:27:09 +00:00
|
|
|
this.watchHistory = this.getPreferenceBoolean("watchHistory", false);
|
2021-09-23 22:57:26 +00:00
|
|
|
this.selectedLanguage = this.getPreferenceString("hl", this.defaultLangage);
|
2021-08-27 07:33:55 +00:00
|
|
|
this.enabledCodecs = this.getPreferenceString("enabledCodecs", "av1,vp9,avc").split(",");
|
2021-09-02 13:46:27 +00:00
|
|
|
this.disableLBRY = this.getPreferenceBoolean("disableLBRY", false);
|
|
|
|
this.proxyLBRY = this.getPreferenceBoolean("proxyLBRY", false);
|
2021-09-21 20:24:21 +00:00
|
|
|
if (this.selectedLanguage != "en") {
|
|
|
|
try {
|
2021-12-28 14:39:20 +00:00
|
|
|
this.CountryMap = await import(`../utils/CountryMaps/${this.selectedLanguage}.json`).then(
|
|
|
|
val => val.default,
|
2021-09-23 22:37:40 +00:00
|
|
|
);
|
2021-09-21 20:24:21 +00:00
|
|
|
} catch (e) {
|
|
|
|
console.error("Countries not translated into " + this.selectedLanguage);
|
|
|
|
}
|
|
|
|
}
|
2021-02-25 14:40:40 +00:00
|
|
|
}
|
2020-11-17 05:15:35 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onChange() {
|
2021-08-28 12:00:17 +00:00
|
|
|
if (this.testLocalStorage) {
|
2021-06-28 19:45:03 +00:00
|
|
|
var shouldReload = false;
|
|
|
|
|
2021-08-22 10:27:09 +00:00
|
|
|
if (
|
|
|
|
this.getPreferenceString("theme", "dark") !== this.selectedTheme ||
|
2021-08-25 16:30:21 +00:00
|
|
|
this.getPreferenceBoolean("watchHistory", false) != this.watchHistory ||
|
2021-09-23 22:57:26 +00:00
|
|
|
this.getPreferenceString("hl", this.defaultLangage) !== this.selectedLanguage ||
|
2021-08-27 07:33:55 +00:00
|
|
|
this.getPreferenceString("enabledCodecs", "av1,vp9,avc") !== this.enabledCodecs.join(",")
|
2021-08-22 10:27:09 +00:00
|
|
|
)
|
|
|
|
shouldReload = true;
|
2021-06-28 19:45:03 +00:00
|
|
|
|
2020-11-17 05:15:35 +00:00
|
|
|
localStorage.setItem("instance", this.selectedInstance);
|
2021-02-25 14:40:40 +00:00
|
|
|
localStorage.setItem("sponsorblock", this.sponsorBlock);
|
2021-02-25 15:18:59 +00:00
|
|
|
|
|
|
|
var sponsorSelected = [];
|
|
|
|
if (this.skipSponsor) sponsorSelected.push("sponsor");
|
|
|
|
if (this.skipIntro) sponsorSelected.push("intro");
|
|
|
|
if (this.skipOutro) sponsorSelected.push("outro");
|
2021-07-18 19:53:17 +00:00
|
|
|
if (this.skipPreview) sponsorSelected.push("preview");
|
2021-02-25 15:18:59 +00:00
|
|
|
if (this.skipInteraction) sponsorSelected.push("interaction");
|
|
|
|
if (this.skipSelfPromo) sponsorSelected.push("selfpromo");
|
2021-04-07 11:45:40 +00:00
|
|
|
if (this.skipMusicOffTopic) sponsorSelected.push("music_offtopic");
|
2022-01-13 09:42:21 +00:00
|
|
|
if (this.skipHighlight) sponsorSelected.push("poi_highlight");
|
|
|
|
if (this.skipFiller) sponsorSelected.push("filler");
|
2021-02-25 15:18:59 +00:00
|
|
|
localStorage.setItem("selectedSkip", sponsorSelected);
|
2021-05-06 17:30:02 +00:00
|
|
|
|
2021-06-28 19:45:03 +00:00
|
|
|
localStorage.setItem("theme", this.selectedTheme);
|
2021-05-06 17:30:02 +00:00
|
|
|
localStorage.setItem("playerAutoPlay", this.autoPlayVideo);
|
2021-07-03 19:24:09 +00:00
|
|
|
localStorage.setItem("listen", this.listen);
|
2021-06-21 20:03:11 +00:00
|
|
|
localStorage.setItem("quality", this.defaultQuality);
|
2021-06-22 10:54:20 +00:00
|
|
|
localStorage.setItem("bufferGoal", this.bufferingGoal);
|
2021-10-08 18:52:51 +00:00
|
|
|
localStorage.setItem("region", this.countrySelected);
|
2021-07-18 20:20:35 +00:00
|
|
|
localStorage.setItem("homepage", this.defaultHomepage);
|
2021-07-18 20:27:34 +00:00
|
|
|
localStorage.setItem("comments", this.showComments);
|
2021-07-30 09:03:16 +00:00
|
|
|
localStorage.setItem("minimizeDescription", this.minimizeDescription);
|
2021-08-22 10:27:09 +00:00
|
|
|
localStorage.setItem("watchHistory", this.watchHistory);
|
2021-08-25 16:30:21 +00:00
|
|
|
localStorage.setItem("hl", this.selectedLanguage);
|
2021-08-27 07:33:55 +00:00
|
|
|
localStorage.setItem("enabledCodecs", this.enabledCodecs.join(","));
|
2021-09-02 13:46:27 +00:00
|
|
|
localStorage.setItem("disableLBRY", this.disableLBRY);
|
|
|
|
localStorage.setItem("proxyLBRY", this.proxyLBRY);
|
2021-06-28 19:45:03 +00:00
|
|
|
|
|
|
|
if (shouldReload) window.location.reload();
|
2021-02-25 14:40:40 +00:00
|
|
|
}
|
2020-11-30 06:39:40 +00:00
|
|
|
},
|
|
|
|
sslScore(url) {
|
2021-04-07 11:45:40 +00:00
|
|
|
return "https://www.ssllabs.com/ssltest/analyze.html?d=" + new URL(url).host + "&latest";
|
|
|
|
},
|
|
|
|
},
|
2020-11-17 05:15:35 +00:00
|
|
|
};
|
|
|
|
</script>
|