Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

fixed redis #94

Merged
merged 3 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/api/v2/episode/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 1 addition & 3 deletions pages/api/v2/etc/schedule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading