diff --git a/.env.EXAMPLE b/.env.EXAMPLE index 205710f..938d3e8 100644 --- a/.env.EXAMPLE +++ b/.env.EXAMPLE @@ -1,6 +1,8 @@ HASHTAG_FILTER = ichlausche,music,musik,nowplaying,tunetuesday,nowlistening URL_FILTER = song.link,album.link,spotify.com,music.apple.com,bandcamp.com YOUTUBE_API_KEY = CHANGE_ME +MASTODON_INSTANCE = 'metalhead.club' VERBOSE = false -PUBLIC_REFRESH_INTERVAL = 10000 \ No newline at end of file +PUBLIC_REFRESH_INTERVAL = 10000 +PUBLIC_MASTODON_INSTANCE_DISPLAY_NAME = 'Metalhead.club' \ No newline at end of file diff --git a/src/lib/server/timeline.ts b/src/lib/server/timeline.ts index f462c33..3bd7962 100644 --- a/src/lib/server/timeline.ts +++ b/src/lib/server/timeline.ts @@ -1,4 +1,4 @@ -import { HASHTAG_FILTER, URL_FILTER, YOUTUBE_API_KEY } from '$env/static/private'; +import { HASHTAG_FILTER, MASTODON_INSTANCE, URL_FILTER, YOUTUBE_API_KEY } from '$env/static/private'; import type { Post, Tag, TimelineEvent } from '$lib/mastodon/response'; import { savePost } from '$lib/server/db'; import { WebSocket } from "ws"; @@ -55,7 +55,7 @@ export class TimelineReader { } private constructor() { - const socket = new WebSocket("wss://metalhead.club/api/v1/streaming") + const socket = new WebSocket(`wss://${MASTODON_INSTANCE}/api/v1/streaming`); socket.onopen = (_event) => { socket.send('{ "type": "subscribe", "stream": "public:local"}'); }; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 0f7bdd0..08a134d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -2,7 +2,7 @@ import { onMount } from "svelte"; import type { PageData } from './$types'; import type { Post } from '$lib/mastodon/response'; -import { PUBLIC_REFRESH_INTERVAL } from '$env/static/public'; +import { PUBLIC_REFRESH_INTERVAL, PUBLIC_MASTODON_INSTANCE_DISPLAY_NAME } from '$env/static/public'; import PostComponent from '$lib/components/PostComponent.svelte'; import LoadMoreComponent from '$lib/components/LoadMoreComponent.svelte'; @@ -76,9 +76,9 @@ async function loadOlderPosts() { - Metalhead.club music list + {PUBLIC_MASTODON_INSTANCE_DISPLAY_NAME} music list -

Metalhead.club music list

+

{PUBLIC_MASTODON_INSTANCE_DISPLAY_NAME} music list