This commit is contained in:
2025-12-02 21:16:05 +01:00
parent 01376362af
commit f479d87584
4 changed files with 5 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ async function loadAnime() {
} }
const fetchUrl = extensionName const fetchUrl = extensionName
? `/api/anime/${animeId.slice(0,40)}?ext=${extensionName}` ? `/api/anime/${animeId}?ext=${extensionName}`
: `/api/anime/${animeId}`; : `/api/anime/${animeId}`;
const res = await fetch(fetchUrl); const res = await fetch(fetchUrl);
const data = await res.json(); const data = await res.json();

View File

@@ -52,10 +52,7 @@ async function loadMetadata() {
format = data.format || '--'; format = data.format || '--';
season = data.season ? data.season.charAt(0) + data.season.slice(1).toLowerCase() : ''; season = data.season ? data.season.charAt(0) + data.season.slice(1).toLowerCase() : '';
seasonYear = data.seasonYear || ''; seasonYear = data.seasonYear || '';
episodesCount = data.episodes || 0;
characters = data.characters?.edges || [];
} else { } else {
title = data.title || 'Anime Title'; title = data.title || 'Anime Title';
description = data.summary || 'No description available.'; description = data.summary || 'No description available.';
coverImage = data.image || ''; coverImage = data.image || '';
@@ -63,8 +60,6 @@ async function loadMetadata() {
format = '--'; format = '--';
season = data.season || ''; season = data.season || '';
seasonYear = data.year || ''; seasonYear = data.year || '';
episodesCount = data.episodes || 0;
characters = data.characters || [];
} }
document.getElementById('anime-title-details').innerText = title; document.getElementById('anime-title-details').innerText = title;
@@ -276,7 +271,7 @@ async function loadStream() {
setLoading(`Loading stream (${audioMode})...`); setLoading(`Loading stream (${audioMode})...`);
try { try {
const url = `/api/watch/stream?animeId=${animeId.slice(0, 30)}&episode=${currentEpisode}&server=${server}&category=${audioMode}&ext=${currentExtension}`; const url = `/api/watch/stream?animeId=${animeId}&episode=${currentEpisode}&server=${server}&category=${audioMode}&ext=${currentExtension}`;
const res = await fetch(url); const res = await fetch(url);
const data = await res.json(); const data = await res.json();

View File

@@ -25,12 +25,11 @@ async function init() {
const idForFetch = currentBookId; const idForFetch = currentBookId;
const fetchUrl = extensionName const fetchUrl = extensionName
? `/api/book/${idForFetch.slice(0,40)}?ext=${extensionName}` ? `/api/book/${idForFetch}?ext=${extensionName}`
: `/api/book/${idForFetch}`; : `/api/book/${idForFetch}`;
const res = await fetch(fetchUrl); const res = await fetch(fetchUrl);
const data = await res.json(); const data = await res.json();
console.log(data);
if (data.error || !data) { if (data.error || !data) {
const titleEl = document.getElementById('title'); const titleEl = document.getElementById('title');
@@ -131,7 +130,7 @@ async function loadChapters(idForFetch) {
try { try {
const fetchUrl = extensionName const fetchUrl = extensionName
? `/api/book/${idForFetch.slice(0, 40)}/chapters` ? `/api/book/${idForFetch}/chapters`
: `/api/book/${idForFetch}/chapters`; : `/api/book/${idForFetch}/chapters`;
const res = await fetch(fetchUrl); const res = await fetch(fetchUrl);

View File

@@ -125,7 +125,7 @@ async function loadChapter() {
`; `;
try { try {
const res = await fetch(`/api/book/${bookId.slice(0,40)}/${chapter}/${provider}`); const res = await fetch(`/api/book/${bookId}/${chapter}/${provider}`);
const data = await res.json(); const data = await res.json();
if (data.title) { if (data.title) {