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