From 86d6239100d0465178365a03dbe659e728ed80f6 Mon Sep 17 00:00:00 2001 From: Amr Mohammed El-Sheraey <141947355+AmrMsCLL@users.noreply.github.com> Date: Sat, 26 Sep 2026 08:59:59 +0300 Subject: [PATCH] Add MangaUpdates as the default manga and manhwa source MangaUpdates covers licensed titles MangaDex lacks, separates manga from manhwa and manhua by type, and reports the latest chapter for release checks. It is registered ahead of MangaDex, which stays selectable, and Discover offers each source's own sorts and statuses. --- app/frontend/src/pages/DiscoverPage.tsx | 29 +- app/frontend/src/pages/HomePage.tsx | 2 +- app/frontend/src/pages/LegalPages.tsx | 17 +- app/frontend/src/pages/SearchPage.tsx | 2 +- app/frontend/test/discover.spec.tsx | 90 ++++++ .../src/sources/connector-registry.service.ts | 4 +- .../mangaupdates/mangaupdates.service.ts | 256 ++++++++++++++++++ app/server/src/sources/sources.module.ts | 2 + app/server/test/connectors.spec.ts | 12 +- app/server/test/mangaupdates.service.spec.ts | 234 ++++++++++++++++ app/server/test/release-signals.spec.ts | 2 + 11 files changed, 631 insertions(+), 19 deletions(-) create mode 100644 app/frontend/test/discover.spec.tsx create mode 100644 app/server/src/sources/mangaupdates/mangaupdates.service.ts create mode 100644 app/server/test/mangaupdates.service.spec.ts diff --git a/app/frontend/src/pages/DiscoverPage.tsx b/app/frontend/src/pages/DiscoverPage.tsx index 659fef3..223feff 100644 --- a/app/frontend/src/pages/DiscoverPage.tsx +++ b/app/frontend/src/pages/DiscoverPage.tsx @@ -28,7 +28,7 @@ const sections: Array<{ id: Exclude; label: string }> const filterKeys = ['genre', 'year', 'status', 'sort', 'source'] as const; -function statusOptions(category: DiscoverCategory, section: CatalogSection) { +function statusOptions(category: DiscoverCategory, section: CatalogSection, source: string) { if ((category === 'tv' || category === 'anime') && section !== 'search') { return [ ['returning', 'Returning'], @@ -39,7 +39,7 @@ function statusOptions(category: DiscoverCategory, section: CatalogSection) { ['pilot', 'Pilot'], ]; } - if (category === 'manga' || category === 'manhwa') { + if ((category === 'manga' || category === 'manhwa') && source === 'mangadex') { return [ ['ongoing', 'Ongoing'], ['completed', 'Completed'], @@ -50,12 +50,18 @@ function statusOptions(category: DiscoverCategory, section: CatalogSection) { return []; } -function sortOptions(category: DiscoverCategory, section: CatalogSection) { +function sortOptions(category: DiscoverCategory, section: CatalogSection, source: string) { if (category === 'manga' || category === 'manhwa') { - return [ - ['followedCount', 'Most followed'], - ['latestUploadedChapter', 'Latest update'], - ]; + return source === 'mangadex' + ? [ + ['followedCount', 'Most followed'], + ['latestUploadedChapter', 'Latest update'], + ] + : [ + ['list_reading', 'Most read'], + ['month1_pos', 'Trending'], + ['rating', 'Rating'], + ]; } const newest = category === 'movie' ? 'primary_release_date.desc' : 'first_air_date.desc'; return [ @@ -124,7 +130,7 @@ export function DiscoverPage({ attributionUrl: results.data.attributionUrl, }, ); - const statuses = statusOptions(category, section); + const statuses = statusOptions(category, section, source); const activeFilters = filterKeys.filter((key) => searchParams.get(key)).length; const hasFilters = activeFilters > 0; @@ -133,9 +139,12 @@ export function DiscoverPage({ const form = new FormData(event.currentTarget); const next = new URLSearchParams(); if (section === 'search') next.set('q', query); + const sourceChanged = form.has('source') && form.get('source') !== source; for (const key of filterKeys) { const value = String(form.get(key) ?? '').trim(); - if (value) next.set(key, value); + if (value && !(sourceChanged && ['genre', 'status', 'sort'].includes(key))) { + next.set(key, value); + } } navigate(`/discover/${category}/${section}?${next.toString()}`); } @@ -279,7 +288,7 @@ export function DiscoverPage({ Sort diff --git a/app/frontend/src/pages/HomePage.tsx b/app/frontend/src/pages/HomePage.tsx index ca12517..efbe53b 100644 --- a/app/frontend/src/pages/HomePage.tsx +++ b/app/frontend/src/pages/HomePage.tsx @@ -50,7 +50,7 @@ export function HomePage() { aria-label="Title" name="query" onInput={form.field('query').onInput} - placeholder="Search every medium, or paste a TMDB, MangaDex, IGDB or RAWG link" + placeholder="Search every medium, or paste a TMDB, MangaUpdates, MangaDex, IGDB or RAWG link" type="search" />