A decentralized music tracking and discovery platform built on AT Protocol 🎵

Add DISABLED_TEALFM to disable teal.fm per DID

+7
+1
apps/api/src/lib/env.ts
··· 41 41 PRIVATE_KEY_3: str({}), 42 42 MEILISEARCH_URL: str({ devDefault: "http://localhost:7700" }), 43 43 MEILISEARCH_API_KEY: str({}), 44 + DISABLED_TEALFM: str({ default: "" }), 44 45 });
+6
apps/api/src/tealfm/index.ts
··· 4 4 import type * as Status from "lexicon/types/fm/teal/alpha/actor/status"; 5 5 import type { PlayView } from "lexicon/types/fm/teal/alpha/feed/defs"; 6 6 import * as Play from "lexicon/types/fm/teal/alpha/feed/play"; 7 + import { env } from "lib/env"; 7 8 import type { MusicbrainzTrack } from "types/track"; 8 9 9 10 const SUBMISSION_CLIENT_AGENT = "rocksky/v0.0.1"; ··· 22 23 track: MusicbrainzTrack, 23 24 duration: number, 24 25 ) { 26 + if (env.DISABLED_TEALFM.includes(agent.assertDid)) { 27 + console.log(`teal.fm is disabled for ${chalk.cyanBright(agent.assertDid)}`); 28 + return; 29 + } 30 + 25 31 try { 26 32 // wait 60 seconds to ensure the track is actually being played 27 33 await new Promise((resolve) => setTimeout(resolve, 60000));