feat: create route to fetch episodes for a title

Summary:

Test Plan:
This commit is contained in:
2024-05-24 17:07:06 -04:00
parent c5cce2543c
commit 75bb7615f5
11 changed files with 533 additions and 6 deletions

145
src/mocks/anify/episodes.ts Normal file
View File

@@ -0,0 +1,145 @@
import { HttpResponse, http } from "msw";
export function getAnifyEpisodes() {
return http.get("https://api.anify.tv/episodes/:aniListId", () => {
return HttpResponse.json([
{
providerId: "zoro",
episodes: [
{
id: "/watch/spy-classroom-season-2-18468?ep=103233",
isFiller: false,
number: 1,
title: "Mission: Forgetter I",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=103632",
isFiller: false,
number: 2,
title: "Mission: Forgetter II",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=104244",
isFiller: false,
number: 3,
title: "Mission: Forgetter III",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=104620",
isFiller: false,
number: 4,
title: "Mission: Forgetter IV",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=104844",
isFiller: false,
number: 5,
title: "File: Glint",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=105761",
isFiller: false,
number: 6,
title: "File: Dreamspeaker Thea",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=106135",
isFiller: false,
number: 7,
title: "File: Forgetter Annette",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=106518",
isFiller: false,
number: 8,
title: "Mission: Dreamspeaker I",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=106606",
isFiller: false,
number: 9,
title: "Mission: Dreamspeaker II",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=106981",
isFiller: false,
number: 10,
title: "Mission: Dreamspeaker III",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=107176",
isFiller: false,
number: 11,
title: "Mission: Dreamspeaker IV",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
{
id: "/watch/spy-classroom-season-2-18468?ep=107247",
isFiller: false,
number: 12,
title: "File: Flower Garden Lily",
img: null,
hasDub: false,
description: null,
rating: null,
updatedAt: 0,
},
],
},
]);
});
}

View File

@@ -1,5 +1,6 @@
import { getAmvstrmSearchResults } from "./amvstrm/search";
import { getAmvstrmTitle } from "./amvstrm/title";
import { getAnifyEpisodes } from "./anify/episodes";
import { getAnifyTitle } from "./anify/title";
import { getAnilistSearchResults } from "./anilist/search";
import { getAnilistTitle } from "./anilist/title";
@@ -9,5 +10,6 @@ export const handlers = [
getAnilistTitle(),
getAmvstrmSearchResults(),
getAmvstrmTitle(),
getAnifyEpisodes(),
getAnifyTitle(),
];