diff --git a/src/app/site/[site]/feed/route.ts b/src/app/site/[site]/feed/route.ts index 439c723d..eb8db68e 100644 --- a/src/app/site/[site]/feed/route.ts +++ b/src/app/site/[site]/feed/route.ts @@ -26,6 +26,14 @@ export async function GET( const hasAudio = pages.list?.find((page) => page.metadata?.content?.audio) + const email = site?.metadata?.content?.connected_accounts + ?.map((account) => { + const match = account.match(/:\/\/account:(.*)@email/) + if (match) { + return match[1] + } + }) + .find((email) => email) const link = getSiteLink({ subdomain: site?.handle || "", domain: site?.metadata?.content?.custom_domain, @@ -40,8 +48,13 @@ export async function GET( ...(hasAudio && { _itunes: { image: site?.metadata?.content?.avatars?.[0], - author: site?.metadata?.content?.name, + author: + site?.metadata?.content?.site_name || site?.metadata?.content?.name, summary: site?.metadata?.content?.bio, + owner: { + email: email, + name: site?.metadata?.content?.name, + }, }, }), items: pages.list?.map((page) => ({ diff --git a/src/lib/singleton.server.ts b/src/lib/singleton.server.ts deleted file mode 100644 index e4f1e718..00000000 --- a/src/lib/singleton.server.ts +++ /dev/null @@ -1,43 +0,0 @@ -// @ts-nocheck -globalThis._singletons = globalThis._singletons || {} - -export const singleton = (id: string, factory: () => T): T => { - if (!globalThis._singletons[id]) { - globalThis._singletons[id] = factory() - } - return globalThis._singletons[id] -} - -export const singletonAsync = ( - id: string, - factory: () => Promise, - enableSingleton = true, -): { readonly value: T; wait: Promise } => { - if (globalThis._singletons[id] && enableSingleton) { - return { - wait: Promise.resolve(), - - get value() { - return globalThis._singletons[id] - }, - } - } - - let ready = false - - const wait = factory().then((value) => { - ready = true - globalThis._singletons[id] = value - }) - - return { - wait, - - get value() { - if (!ready) { - throw new Error(`please await .wait before using the value of '${id}'`) - } - return globalThis._singletons[id] - }, - } -}