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

Commit

Permalink
fixed redis (#94)
Browse files Browse the repository at this point in the history
* fixed schedules

* fixed redis
  • Loading branch information
Aijazmakerb authored Oct 22, 2023
1 parent f801f8f commit 2389d9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
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

0 comments on commit 2389d9a

Please sign in to comment.