novel extensions dont appear on manga entry and viceversa

This commit is contained in:
2026-01-01 19:47:28 +01:00
parent d09c769804
commit edb8a93395
10 changed files with 96 additions and 18 deletions

View File

@@ -499,11 +499,18 @@ async function checkLocalLibraryEntry() {
async function loadAvailableExtensions() {
try {
const res = await fetch('/api/extensions/book');
if (!bookData?.entry_type) return;
console.log(bookData.entry_type)
const type = bookData.entry_type === 'MANGA' ? 'manga' : 'novel';
const res = await fetch(`/api/extensions/${type}`);
const data = await res.json();
availableExtensions = data.extensions || [];
setupProviderFilter();
} catch (err) { console.error(err); }
} catch (err) {
console.error(err);
}
}
function setupProviderFilter() {

View File

@@ -1,4 +1,4 @@
const API_BASE = '/api/config';
const API_BASE2 = '/api/config';
let currentConfig = {};
let currentSchema = {};
let activeSection = '';
@@ -38,7 +38,7 @@ async function loadSettings() {
`;
try {
const res = await fetch(API_BASE);
const res = await fetch(API_BASE2);
if (!res.ok) throw new Error(`HTTP error! status: ${res.status}`);
const data = await res.json();
@@ -172,7 +172,7 @@ async function saveSettings() {
});
try {
const res = await fetch(`${API_BASE}/${activeSection}`, {
const res = await fetch(`${API_BASE2}/${activeSection}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(updatedData)