support for novels and lot of formats for books
This commit is contained in:
@@ -32,12 +32,12 @@ let localEntryId = null;
|
||||
async function checkLocal() {
|
||||
try {
|
||||
const res = await fetch(`/api/library/anime/${animeId}`);
|
||||
if (!res.ok) return;
|
||||
|
||||
if (!res.ok) return null;
|
||||
const data = await res.json();
|
||||
localEntryId = data.id; // ← ID interna
|
||||
|
||||
} catch {}
|
||||
return data.id;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function loadAniSkip(malId, episode, duration) {
|
||||
@@ -53,7 +53,7 @@ async function loadAniSkip(malId, episode, duration) {
|
||||
}
|
||||
|
||||
async function loadMetadata() {
|
||||
checkLocal();
|
||||
localEntryId = await checkLocal();
|
||||
try {
|
||||
const sourceQuery = (extName === 'local' || !extName) ? "source=anilist" : `source=${extName}`;
|
||||
const res = await fetch(`/api/anime/${animeId}?${sourceQuery}`);
|
||||
@@ -133,6 +133,7 @@ async function loadMetadata() {
|
||||
} catch (error) {
|
||||
console.error('Error loading metadata:', error);
|
||||
}
|
||||
await loadExtensions();
|
||||
}
|
||||
|
||||
async function applyAniSkip(video) {
|
||||
@@ -484,4 +485,3 @@ setInterval(() => {
|
||||
}, 60000);
|
||||
|
||||
loadMetadata();
|
||||
loadExtensions();
|
||||
Reference in New Issue
Block a user