diff --git a/desktop/src/scripts/anime/anime.js b/desktop/src/scripts/anime/anime.js index 2ea41f0..b637837 100644 --- a/desktop/src/scripts/anime/anime.js +++ b/desktop/src/scripts/anime/anime.js @@ -64,7 +64,7 @@ async function loadAnime() { } animeData = data; - + animeData.entry_type = 'ANIME'; const metadata = MediaMetadataUtils.formatAnimeData(data, !!extensionName); updatePageTitle(metadata.title); diff --git a/desktop/src/scripts/anime/animes.js b/desktop/src/scripts/anime/animes.js index 3f18f32..c9a0224 100644 --- a/desktop/src/scripts/anime/animes.js +++ b/desktop/src/scripts/anime/animes.js @@ -92,6 +92,7 @@ function startHeroCycle() { async function updateHeroUI(anime) { if(!anime) return; + anime.entry_type = 'ANIME'; const title = anime.title.english || anime.title.romaji || "Unknown Title"; const score = anime.averageScore ? anime.averageScore + '% Match' : 'N/A'; diff --git a/desktop/src/scripts/books/book.js b/desktop/src/scripts/books/book.js index 22f2cb6..2ee4a93 100644 --- a/desktop/src/scripts/books/book.js +++ b/desktop/src/scripts/books/book.js @@ -69,7 +69,8 @@ async function loadBookMetadata() { bookData = raw; const metadata = MediaMetadataUtils.formatBookData(raw, !!extensionName); - + bookData.entry_type = + metadata.format === 'MANGA' ? 'MANGA' : 'NOVEL'; updatePageTitle(metadata.title); updateMetadata(metadata); updateExtensionPill(); diff --git a/desktop/src/scripts/books/books.js b/desktop/src/scripts/books/books.js index 95de71a..2891158 100644 --- a/desktop/src/scripts/books/books.js +++ b/desktop/src/scripts/books/books.js @@ -55,7 +55,8 @@ function startHeroCycle() { async function updateHeroUI(book) { if(!book) return; - + book.entry_type = + book.format === 'MANGA' ? 'MANGA' : 'NOVEL'; const title = book.title.english || book.title.romaji; const desc = book.description || "No description available."; const poster = (book.coverImage && (book.coverImage.extraLarge || book.coverImage.large)) || ''; diff --git a/desktop/src/scripts/gallery/gallery.js b/desktop/src/scripts/gallery/gallery.js index 06c46ff..8d9433e 100644 --- a/desktop/src/scripts/gallery/gallery.js +++ b/desktop/src/scripts/gallery/gallery.js @@ -299,7 +299,7 @@ async function searchGallery(isLoadMore = false) { const msg = favoritesMode ? (query ? 'No favorites found matching your search' : 'You don\'t have any favorite images yet') : 'No results found'; - resultsContainer.innerHTML = `
${msg}
`; + resultsContainer.innerHTML = `${msg}
`; } if (msnry) msnry.layout(); diff --git a/desktop/src/scripts/list.js b/desktop/src/scripts/list.js index 6691863..3271bdb 100644 --- a/desktop/src/scripts/list.js +++ b/desktop/src/scripts/list.js @@ -284,7 +284,7 @@ function createListItem(item) { const itemLink = getEntryLink(item); - const posterUrl = item.poster || '/public/assets/placeholder.png'; + const posterUrl = item.poster || '/public/assets/placeholder.svg'; const progress = item.progress || 0; const totalUnits = item.entry_type === 'ANIME' ? diff --git a/desktop/src/scripts/utils/list-modal-manager.js b/desktop/src/scripts/utils/list-modal-manager.js index be33a4a..5d61eef 100644 --- a/desktop/src/scripts/utils/list-modal-manager.js +++ b/desktop/src/scripts/utils/list-modal-manager.js @@ -83,7 +83,7 @@ const ListModalManager = { document.getElementById('progress-label'); if (this.isInList && this.currentEntry) { - document.getElementById('entry-status').value = this.currentEntry.status || 'PLANNING'; + document.getElementById('entry-status').value = this.normalizeStatus(this.currentEntry.status); document.getElementById('entry-progress').value = this.currentEntry.progress || 0; document.getElementById('entry-score').value = this.currentEntry.score || ''; document.getElementById('entry-start-date').value = this.currentEntry.start_date?.split('T')[0] || ''; @@ -131,6 +131,12 @@ const ListModalManager = { document.getElementById('add-list-modal').classList.add('active'); }, + normalizeStatus(status) { + if (!status) return 'PLANNING'; + if (status === 'WATCHING' || status === 'READING') return 'CURRENT'; + return status; + }, + close() { document.getElementById('add-list-modal').classList.remove('active'); }, @@ -212,15 +218,21 @@ const ListModalManager = { } }; -document.addEventListener('DOMContentLoaded', () => { +async function loadListModal() { + if (document.getElementById('add-list-modal')) return; + + const res = await fetch('/views/components/list-modal.html'); + const html = await res.text(); + document.body.insertAdjacentHTML('beforeend', html); + const modal = document.getElementById('add-list-modal'); - if (modal) { - modal.addEventListener('click', (e) => { - if (e.target.id === 'add-list-modal') { - ListModalManager.close(); - } - }); - } -}); + modal.addEventListener('click', (e) => { + if (e.target.id === 'add-list-modal') { + ListModalManager.close(); + } + }); +} + +document.addEventListener('DOMContentLoaded', loadListModal); window.ListModalManager = ListModalManager; \ No newline at end of file diff --git a/desktop/views/anime/anime.html b/desktop/views/anime/anime.html index b962931..ae75aaa 100644 --- a/desktop/views/anime/anime.html +++ b/desktop/views/anime/anime.html @@ -34,75 +34,6 @@ - - Back to Home diff --git a/desktop/views/anime/animes.html b/desktop/views/anime/animes.html index f8a8e04..801c84f 100644 --- a/desktop/views/anime/animes.html +++ b/desktop/views/anime/animes.html @@ -157,73 +157,6 @@ - -Update available: v1.x
diff --git a/desktop/views/books/book.html b/desktop/views/books/book.html index e75e682..f26b48e 100644 --- a/desktop/views/books/book.html +++ b/desktop/views/books/book.html @@ -25,72 +25,6 @@Update available: v1.x
diff --git a/docker/views/books/book.html b/docker/views/books/book.html index 4b44b7f..67cd99f 100644 --- a/docker/views/books/book.html +++ b/docker/views/books/book.html @@ -13,72 +13,6 @@ - Back to Books diff --git a/docker/views/books/books.html b/docker/views/books/books.html index bc658e1..c291843 100644 --- a/docker/views/books/books.html +++ b/docker/views/books/books.html @@ -38,72 +38,6 @@