Disable RYD in env

This commit is contained in:
WardPearce
2024-04-23 19:15:00 +12:00
parent d79545e02a
commit 582ca898ed
5 changed files with 23 additions and 10 deletions
+1
View File
@@ -154,6 +154,7 @@ services:
VITE_DEFAULT_INVIDIOUS_INSTANCE: "https://invidious.materialio.us"
# URL TO RYD
# Leave blank to disable completely.
VITE_DEFAULT_RETURNYTDISLIKES_INSTANCE: "https://returnyoutubedislikeapi.com"
# URL to your proxied instance of Materialious
+1
View File
@@ -0,0 +1 @@
declare module 'virtual:pwa-info';
@@ -10,7 +10,7 @@ import type { PlaylistPage } from '$lib/Api/model';
import { phaseDescription } from '$lib/misc';
import { error } from '@sveltejs/kit';
import { get } from 'svelte/store';
import { authStore, playerProxyVideosStore, returnYtDislikesStore } from '../../../store';
import { authStore, playerProxyVideosStore, returnYTDislikesInstanceStore, returnYtDislikesStore } from '../../../store';
export async function load({ params, url }) {
let video;
@@ -60,11 +60,12 @@ export async function load({ params, url }) {
comments = null;
}
let returnYTDislikes;
try {
returnYTDislikes = get(returnYtDislikesStore) ? await getDislikes(params.slug) : null;
} catch {
returnYTDislikes = null;
let returnYTDislikes = null;
const returnYTDislikesInstance = get(returnYTDislikesInstanceStore);
if (returnYTDislikesInstance && returnYTDislikesInstance !== "") {
try {
returnYTDislikes = get(returnYtDislikesStore) ? await getDislikes(params.slug) : null;
} catch { }
}
return {
+1 -1
View File
@@ -3,7 +3,7 @@ import type { DataConnection } from 'peerjs';
import { persisted } from 'svelte-persisted-store';
import { writable, type Writable } from 'svelte/store';
export const returnYTDislikesInstanceStore = persisted(
export const returnYTDislikesInstanceStore: Writable<string | null | undefined> = persisted(
'returnYTDislikesInstance',
import.meta.env.VITE_DEFAULT_RETURNYTDISLIKES_INSTANCE
);
+13 -3
View File
@@ -10,10 +10,20 @@
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler",
"types": ["vidstack/svelte"]
}
"types": [
"vidstack/svelte"
]
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts"
],
"exclude": [
"node_modules",
"dist"
]
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}
}