mirror of
https://github.com/Shineii86/AniKotoAPI.git
synced 2026-10-22 19:05:11 +00:00
v1.9.2: Fix 3 endpoint bugs found in diagnostic sweep
- filter controller: Normalize array params to strings (genre[]=1 now works) - status controller: Map short names to full slugs (airing → currently-airing) - seasons extractor: Remove recursive API call, throw clear error - watchOrder extractor: Remove recursive API call, throw clear error Endpoint status: 27/31 passing (4 remaining: 2 source site issues, 1 AJAX issue, 1 expected behavior)
This commit is contained in:
@@ -36,21 +36,7 @@ import { BASE_URL } from "../configs/dataUrl.js";
|
||||
* console.log(seasons.length); // Number of seasons
|
||||
*/
|
||||
const extractSeasons = async (animeId) => {
|
||||
try {
|
||||
// NOTE: This is an internal API endpoint requiring X-Requested-With header
|
||||
const url = `${BASE_URL}/api/seasons/${animeId}`;
|
||||
const { data } = await axios.get(url, {
|
||||
headers: {
|
||||
...headers,
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
}
|
||||
});
|
||||
|
||||
return data || [];
|
||||
} catch (error) {
|
||||
// NOTE: Return empty array on error to maintain consistent API
|
||||
throw error;
|
||||
}
|
||||
throw new Error("Seasons endpoint not available - source site does not provide this data");
|
||||
};
|
||||
|
||||
export { extractSeasons };
|
||||
|
||||
Reference in New Issue
Block a user