feat: support sending "new episode" notifications to devices
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { EpisodeNumberSchema } from "~/types/schema";
|
||||
|
||||
export type Episode = z.infer<typeof Episode>;
|
||||
export const Episode = z.object({
|
||||
id: z.string(),
|
||||
number: EpisodeNumberSchema,
|
||||
title: z.string().nullish(),
|
||||
img: z.string().nullish(),
|
||||
description: z.string().nullish(),
|
||||
rating: z.number().int().nullish(),
|
||||
updatedAt: z.number().int().default(0).openapi({ format: "int64" }),
|
||||
});
|
||||
|
||||
export type EpisodesResponse = z.infer<typeof EpisodesResponse>;
|
||||
export const EpisodesResponse = z.object({
|
||||
providerId: z.string(),
|
||||
episodes: z.array(Episode),
|
||||
});
|
||||
@@ -3,17 +3,14 @@ import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
|
||||
import { fetchFromMultipleSources } from "~/libs/fetchFromMultipleSources";
|
||||
import { readEnvVariable } from "~/libs/readEnvVariable";
|
||||
import type { Env } from "~/types/env";
|
||||
import { EpisodesResponseSchema } from "~/types/episode";
|
||||
import {
|
||||
AniListIdQuerySchema,
|
||||
ErrorResponse,
|
||||
ErrorResponseSchema,
|
||||
SuccessResponseSchema,
|
||||
} from "~/types/schema";
|
||||
|
||||
import { getEpisodesFromAnify } from "./anify";
|
||||
import { EpisodesResponse } from "./episode";
|
||||
|
||||
const EpisodesResponseSchema = SuccessResponseSchema(EpisodesResponse);
|
||||
|
||||
const route = createRoute({
|
||||
tags: ["aniplay", "episodes"],
|
||||
|
||||
Reference in New Issue
Block a user