mirror of
https://github.com/JustAnimeCore/HiAnime-Api.git
synced 2026-04-17 22:01:44 +00:00
feature, not a bug
This commit is contained in:
21
src/controllers/episodeList.controller.js
Normal file
21
src/controllers/episodeList.controller.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import extractEpisodesList from "../extractors/episodeList.extractor.js";
|
||||
import { getCachedData, setCachedData } from "../helper/cache.helper.js";
|
||||
|
||||
export const getEpisodes = async (req,res) => {
|
||||
const { id } = req.params;
|
||||
// const cacheKey = `episodes_${id}`;
|
||||
try {
|
||||
// const cachedResponse = await getCachedData(cacheKey);
|
||||
// if (cachedResponse && Object.keys(cachedResponse).length > 0) {
|
||||
// return cachedResponse;
|
||||
// }
|
||||
const data = await extractEpisodesList(encodeURIComponent(id));
|
||||
// setCachedData(cacheKey, data).catch((err) => {
|
||||
// console.error("Failed to set cache:", err);
|
||||
// });
|
||||
return data;
|
||||
} catch (e) {
|
||||
console.error("Error fetching episodes:", e);
|
||||
return e;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user