now on my list page, source dropdown only shows anime and book extensions
This commit is contained in:
@@ -29,20 +29,32 @@ async function populateSourceFilter() {
|
||||
`;
|
||||
|
||||
try {
|
||||
const response = await fetch(`${API_BASE}/extensions`);
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
const extensions = data.extensions || [];
|
||||
const [animeRes, bookRes] = await Promise.all([
|
||||
fetch(`${API_BASE}/extensions/anime`),
|
||||
fetch(`${API_BASE}/extensions/book`)
|
||||
]);
|
||||
|
||||
extensions.forEach(extName => {
|
||||
if (extName.toLowerCase() !== 'anilist' && extName.toLowerCase() !== 'local') {
|
||||
const option = document.createElement('option');
|
||||
option.value = extName;
|
||||
option.textContent = extName.charAt(0).toUpperCase() + extName.slice(1);
|
||||
select.appendChild(option);
|
||||
}
|
||||
});
|
||||
const extensions = new Set();
|
||||
|
||||
if (animeRes.ok) {
|
||||
const data = await animeRes.json();
|
||||
(data.extensions || []).forEach(ext => extensions.add(ext));
|
||||
}
|
||||
|
||||
if (bookRes.ok) {
|
||||
const data = await bookRes.json();
|
||||
(data.extensions || []).forEach(ext => extensions.add(ext));
|
||||
}
|
||||
|
||||
extensions.forEach(extName => {
|
||||
const lower = extName.toLowerCase();
|
||||
if (lower !== 'anilist' && lower !== 'local') {
|
||||
const option = document.createElement('option');
|
||||
option.value = extName;
|
||||
option.textContent = extName.charAt(0).toUpperCase() + extName.slice(1);
|
||||
select.appendChild(option);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error loading extensions:', error);
|
||||
}
|
||||
|
||||
@@ -29,20 +29,32 @@ async function populateSourceFilter() {
|
||||
`;
|
||||
|
||||
try {
|
||||
const response = await fetch(`${API_BASE}/extensions`);
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
const extensions = data.extensions || [];
|
||||
const [animeRes, bookRes] = await Promise.all([
|
||||
fetch(`${API_BASE}/extensions/anime`),
|
||||
fetch(`${API_BASE}/extensions/book`)
|
||||
]);
|
||||
|
||||
extensions.forEach(extName => {
|
||||
if (extName.toLowerCase() !== 'anilist' && extName.toLowerCase() !== 'local') {
|
||||
const option = document.createElement('option');
|
||||
option.value = extName;
|
||||
option.textContent = extName.charAt(0).toUpperCase() + extName.slice(1);
|
||||
select.appendChild(option);
|
||||
}
|
||||
});
|
||||
const extensions = new Set();
|
||||
|
||||
if (animeRes.ok) {
|
||||
const data = await animeRes.json();
|
||||
(data.extensions || []).forEach(ext => extensions.add(ext));
|
||||
}
|
||||
|
||||
if (bookRes.ok) {
|
||||
const data = await bookRes.json();
|
||||
(data.extensions || []).forEach(ext => extensions.add(ext));
|
||||
}
|
||||
|
||||
extensions.forEach(extName => {
|
||||
const lower = extName.toLowerCase();
|
||||
if (lower !== 'anilist' && lower !== 'local') {
|
||||
const option = document.createElement('option');
|
||||
option.value = extName;
|
||||
option.textContent = extName.charAt(0).toUpperCase() + extName.slice(1);
|
||||
select.appendChild(option);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error loading extensions:', error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user