mirror of
https://github.com/shafat-96/anicrush-api.git
synced 2026-04-17 15:51:44 +00:00
fix
This commit is contained in:
4
index.js
4
index.js
@@ -284,13 +284,13 @@ app.get('/api/anime/:anilistId/:episodeNum', async (req, res) => {
|
||||
|
||||
// Find the specific episode data
|
||||
const episodeNumber = parseInt(episodeNum) || 1;
|
||||
const episodeData = mappedData.episodes.find(ep => ep.number === episodeNumber) || {};
|
||||
const episodeData = (mappedData.episodes || []).find(ep => ep.number === episodeNumber) || {};
|
||||
|
||||
// Add metadata from the mapped data
|
||||
const response = {
|
||||
...hlsData,
|
||||
metadata: {
|
||||
title: mappedData.titles?.english || mappedData.titles?.romaji,
|
||||
title: mappedData.title?.english || mappedData.title?.romaji,
|
||||
anilistId: parseInt(anilistId),
|
||||
movieId: movieId,
|
||||
episode: episodeNumber,
|
||||
|
||||
Reference in New Issue
Block a user