diff --git a/pages/api/v2/episode/[id].js b/pages/api/v2/episode/[id].js index 3f1372b8..b86a1983 100644 --- a/pages/api/v2/episode/[id].js +++ b/pages/api/v2/episode/[id].js @@ -238,7 +238,7 @@ export default async function handler(req, res) { if (meta) { data = await appendMetaToEpisodes(filteredData, JSON.parse(meta)); } else if (cover && !cover.some((e) => e.img === null)) { - await redis.set(`meta:${id}`, JSON.stringify(cover)); + if (redis) await redis.set(`meta:${id}`, JSON.stringify(cover)); data = await appendMetaToEpisodes(filteredData, cover); } diff --git a/pages/api/v2/etc/schedule/index.js b/pages/api/v2/etc/schedule/index.js index 9b8f43d9..2ddc82a2 100644 --- a/pages/api/v2/etc/schedule/index.js +++ b/pages/api/v2/etc/schedule/index.js @@ -2,13 +2,11 @@ import axios from "axios"; import cron from "cron"; import { rateLimiterRedis, redis } from "@/lib/redis"; -const API_KEY = process.env.API_KEY; - // Function to fetch new data async function fetchData() { try { const { data } = await axios.get( - `https://api.anify.tv/schedule?apikey=${API_KEY}` + `https://api.anify.tv/schedule?fields=[id,coverImage,title,bannerImage]` ); return data; } catch (error) {