Some checks failed
Deploy / Deploy (push) Has been cancelled
also removed any references to Anify
16 lines
461 B
TypeScript
16 lines
461 B
TypeScript
import type { GraphQLContext } from "~/context";
|
|
import { fetchEpisodeUrl } from "~/services/episodes/getEpisodeUrl";
|
|
|
|
export async function episodeStream(
|
|
_parent: unknown,
|
|
args: { id: string },
|
|
context: GraphQLContext,
|
|
) {
|
|
const episodeUrl = await fetchEpisodeUrl({ id: args.id });
|
|
if (!episodeUrl || !episodeUrl.success) {
|
|
throw new Error("Failed to fetch episode URL");
|
|
}
|
|
|
|
return { ...episodeUrl.result, url: episodeUrl.result.source };
|
|
}
|