From c17f14ee9eca1e0090673d0c508e433393bd909c Mon Sep 17 00:00:00 2001 From: MooshiMochi Date: Mon, 20 Jan 2025 13:12:29 +0000 Subject: [PATCH] fixed ataraxia updates + removed premium chapter tracking from asura --- .../0bc8821d-f561-4efd-af3d-8e8d02375fc1.xml | 2021 +++++++++++++++++ Changelog.md | 9 + src/core/scanlators/lookup_map.json | 2 +- src/ext/update_check.py | 55 +- tests/__main__.py | 4 +- tests/test_map.json | 2 +- 6 files changed, 2062 insertions(+), 31 deletions(-) create mode 100644 .idea/dataSources/0bc8821d-f561-4efd-af3d-8e8d02375fc1.xml diff --git a/.idea/dataSources/0bc8821d-f561-4efd-af3d-8e8d02375fc1.xml b/.idea/dataSources/0bc8821d-f561-4efd-af3d-8e8d02375fc1.xml new file mode 100644 index 0000000..9f2af60 --- /dev/null +++ b/.idea/dataSources/0bc8821d-f561-4efd-af3d-8e8d02375fc1.xml @@ -0,0 +1,2021 @@ + + + + + 3.45.1 + + + + + + + + + + + + + + + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + + window + + + 1 + + + 1 + + + 1 + + + + 1 + 1 + + + + + 1 + 1 + + + 1 + 1 + + + 1 + 1 + + + 1 + + + 1 + + + + + window + + + window + + + + + + 1 + 1 + + + 1 + 1 + + + 1 + + + window + + + + 1 + + + window + + + 1 + + + 1 + 1 + + + + + + 1 + + + 1 + + + window + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + 1 + + + 1 + + + 1 + + + 1 + 1 + + + 1 + window + + + 1 + window + + + 1 + 1 + + + 1 + 1 + + + 1 + + + 1 + + + 1 + 1 + + + 1 + 1 + + + 1 + 1 + + + 1 + + + 1 + + + 1 + + + 1 + 1 + + + 1 + 1 + + + 1 + window + + + 1 + window + + + 1 + 1 + + + 1 + 1 + + + 1 + + + 1 + 1 + + + 1 + 1 + + + 1 + 1 + + + 1 + 1 + + + window + + + window + + + + window + + + window + + + window + + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + + 1 + + + 1 + + + 1 + + + 1 + + + aggregate + + + 1 + + + + + + 1 + 1 + + + window + + + aggregate + + + 1 + 1 + + + window + + + 1 + + + aggregate + + + window + + + window + + + 1 + + + 1 + + + + + + + + window + + + 1 + + + 1 + + + 1 + + + 1 + 1 + + + + 1 + + + 1 + + + + + window + + + 1 + + + 1 + + + + + + 1 + + + window + + + 1 + + + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + 1 + + + + aggregate + + + + 1 + 1 + + + window + + + 1 + + + 1 + + + 1 + + + window + + + 1 + + + 1 + + + 1 + 1 + + + 1 + + + window + + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + 1 + + + 1 + + + 1 + + + aggregate + + + aggregate + + + 1 + + + 1 + 2025-01-20.13:02:43 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + R + + + 1 + + + R + + + 1 + + + R + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + 3 + + + R + + + R + + + R + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + R + + + R + + + R + + + R + + + R + + + R + + + 1 + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + 3 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + R + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + R + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + R + + + R + + + 1 + + + 2 + + + R + + + R + + + R + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + 3 + + + R + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + 3 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + 3 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + R + + + 1 + + + R + + + 1 + + + R + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + R + + + 1 + + + R + + + R + + + R + + + 1 + + + 2 + + + 3 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + R + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + R + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + 2 + + + 3 + + + R + + + 1 + + + 2 + + + 3 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + 2 + + + R + + + 1 + + + R + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + + R + + + 1 + + +
+
+
+
+
+
+
+ 1 +
+ +
+ + 1 + 1 + INTEGER|0s + + + 1 + 2 + TEXT|0s + + + NULL + 3 + INTEGER|0s + + + 1 + 4 + INTEGER|0s + + + CURRENT_TIMESTAMP + 5 + TIMESTAMP|0s + + + 'Unknown' + 1 + 6 + TEXT|0s + + + 'reading' + 7 + VARCHAR(10)|0s + + + user_id + id + user_subs_old + + + series_id + id + series + + + guild_id + guild_id + guild_config_old + + + scanlator + scanlator + series + + + user_id +series_id +scanlator + 1 + 1 + + + user_id +series_id +scanlator + ignore + sqlite_autoindex_bookmarks_1 + + + 1 + 1 + INTEGER|0s + + + 1 + 2 + INTEGER|0s + + + guild_id +role_id + 1 + 1 + + + guild_id +role_id + replace + sqlite_autoindex_bot_created_roles_1 + + + 1 + 1 + INTEGER|0s + + + 1 + 2 + INTEGER|0s + + + NULL + 3 + INTEGER|0s + + + false + 4 + BOOLEAN|0s + + + null + 5 + INTEGER|0s + + + true + 1 + 6 + BOOLEAN|0s + + + false + 1 + 7 + BOOLEAN|0s + + + NULL + 8 + INTEGER|0s + + + guild_id + 1 + 1 + + + guild_id + 1 + sqlite_autoindex_guild_config_1 + + + guild_id + ignore + sqlite_autoindex_guild_config_1 + + + 1 + 1 + TEXT|0s + + + 2 + INTEGER|0s + + + 1 + 3 + TEXT|0s + + + 1 + 4 + TEXT|0s + + + email + 1 + 1 + + + email + 1 + sqlite_autoindex_patreons_1 + + + email + replace + sqlite_autoindex_patreons_1 + + + 1 + 1 + INTEGER|0s + + + 1 + 2 + TEXT|0s + + + 1 + 3 + INTEGER|0s + + + guild_id + guild_id + guild_config + + + guild_id +scanlator +channel_id + 1 + 1 + + + guild_id +scanlator +channel_id + replace + sqlite_autoindex_scanlator_channel_associations_1 + + + 1 + 1 + TEXT|0s + + + 1 + 1 + 2 + BOOLEAN|0s + + + scanlator + 1 + 1 + + + scanlator + 1 + sqlite_autoindex_scanlators_config_1 + + + 1 + 1 + TEXT|0s + + + 1 + 2 + TEXT|0s + + + 1 + 3 + TEXT|0s + + + 4 + TEXT|0s + + + 1 + 5 + TEXT|0s + + + 6 + TEXT|0s + + + 7 + TEXT|0s + + + 'Ongoing' + 1 + 8 + TEXT|0s + + + 'Unknown' + 1 + 9 + TEXT|0s + + + id +scanlator + 1 + 1 + + + id +scanlator + ignore + sqlite_autoindex_series_1 + + + 1 + TEXT|0s + + + 2 + TEXT|0s + + + 3 + TEXT|0s + + + 4 + INT|0s + + + 5 + TEXT|0s + + + 1 + 1 + INTEGER|0s + + + 1 + 2 + TEXT|0s + + + 3 + INTEGER|0s + + + 'Unknown' + 1 + 4 + TEXT|0s + + + guild_id + guild_id + guild_config_old + + + series_id + id + series_old + + + scanlator + scanlator + series_old + + + guild_id +series_id +scanlator + 1 + 1 + + + guild_id +series_id +scanlator + replace + sqlite_autoindex_tracked_guild_series_1 + + + 1 + 1 + INTEGER|0s + + + 1 + 2 + TEXT|0s + + + 1 + 3 + INTEGER|0s + + + 'Unknown' + 1 + 4 + TEXT|0s + + + series_id + id + series + + + guild_id + guild_id + guild_config_old + + + scanlator + scanlator + series + + + id +series_id +scanlator +guild_id + 1 + 1 + + + id +series_id +scanlator +guild_id + ignore + sqlite_autoindex_user_subs_1 + + + \ No newline at end of file diff --git a/Changelog.md b/Changelog.md index 813ea18..291ea7f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,15 @@ #### Consider supporting me on [Patreon](https://patreon.com/mooshi69) or [Ko-Fi](https://ko-fi.com/mooshi69)! +## January 20th 2024 + +### Bug Fixes: + +- Fixed test case for ataraxia (expected status was true instead of false) +- Fixed issue in update_check.py where the scanlator updates would crash if a manga had no chapters yet +- Updated asura's chapter container selector not to include paid chapters for updates. This will be redacted when the + - option for premium chapter notifications will be introduced. + ## December 22nd 2024 - Improved the search button from the bookmarks view. diff --git a/src/core/scanlators/lookup_map.json b/src/core/scanlators/lookup_map.json index 0493701..e58b1c3 100644 --- a/src/core/scanlators/lookup_map.json +++ b/src/core/scanlators/lookup_map.json @@ -335,7 +335,7 @@ "front_page": { "container": "div.w-full.p-1", "chapters": { - "container": "div.w-full.p-1 > div > div.col-span-9 > div.flex > span > div > div.flex", + "container": "div.w-full.p-1 > div > div.col-span-9 > div.flex > span > div:not(:has(svg.lucide))", "name": "a > span.flex > div.flex > p", "url": "a" }, diff --git a/src/ext/update_check.py b/src/ext/update_check.py index 9a60ed7..77f870d 100644 --- a/src/ext/update_check.py +++ b/src/ext/update_check.py @@ -234,34 +234,35 @@ async def check_with_front_page_scraping( if not partial_manga.latest_chapters: # websites that don't support front page scraping return [] solo_mangas_to_check.append(manga_header) continue - elif manga.last_chapter.url == partial_manga.latest_chapters[-1].url: # no updates here - continue - # elif (manga.last_chapter.url == partial_manga.latest_chapters[-1].url and - # manga.last_chapter.is_premium != partial_manga.latest_chapters[-1].is_premium): # no updates here - # continue - p_manga_chapter_urls = [x.url for x in partial_manga.latest_chapters] - if manga.last_chapter.url in p_manga_chapter_urls: # new chapters - index = p_manga_chapter_urls.index(manga.last_chapter.url) - latest_chapter_index = manga.last_chapter.index + 1 - new_chapters = [] - for chapter in partial_manga.latest_chapters[index + 1:]: - chapter.index = latest_chapter_index - latest_chapter_index += 1 - new_chapters.append(chapter) - manga_chapter_updates.append( - ChapterUpdate( - manga.id, - new_chapters, - manga.scanlator, - partial_manga.cover_url, - manga.status, + if manga.last_chapter is not None: + if manga.last_chapter.url == partial_manga.latest_chapters[-1].url: # no updates here + continue + # elif (manga.last_chapter.url == partial_manga.latest_chapters[-1].url and + # manga.last_chapter.is_premium != partial_manga.latest_chapters[-1].is_premium): # no updates here + # continue + p_manga_chapter_urls = [x.url for x in partial_manga.latest_chapters] + if manga.last_chapter.url in p_manga_chapter_urls: # new chapters + index = p_manga_chapter_urls.index(manga.last_chapter.url) + latest_chapter_index = manga.last_chapter.index + 1 + new_chapters = [] + for chapter in partial_manga.latest_chapters[index + 1:]: + chapter.index = latest_chapter_index + latest_chapter_index += 1 + new_chapters.append(chapter) + manga_chapter_updates.append( + ChapterUpdate( + manga.id, + new_chapters, + manga.scanlator, + partial_manga.cover_url, + manga.status, + ) ) - ) - if scanlator.json_tree.properties.requires_update_embed: - manga_chapter_updates[-1].extra_kwargs = [ - {"embed": scanlator.create_chapter_embed(partial_manga, chapter)} - for chapter in new_chapters - ] + if scanlator.json_tree.properties.requires_update_embed: + manga_chapter_updates[-1].extra_kwargs = [ + {"embed": scanlator.create_chapter_embed(partial_manga, chapter)} + for chapter in new_chapters + ] else: # old chapter is not visible in listed chapters (mass released updates) solo_mangas_to_check.append(manga) diff --git a/tests/__main__.py b/tests/__main__.py index a45e5db..1f3f8c0 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -594,7 +594,7 @@ async def test_single_scanlator(scanlator: str): asyncio.run(main()) else: # asyncio.run(test_single_method("show_front_page_results", "epsilonscans")) - # asyncio.run(test_single_scanlator("flamecomics")) + asyncio.run(test_single_scanlator("ataraxia")) # asyncio.run(sub_main()) # asyncio.run(paused_test()) - asyncio.run(main()) + # asyncio.run(main()) diff --git a/tests/test_map.json b/tests/test_map.json index 080a36d..3952367 100644 --- a/tests/test_map.json +++ b/tests/test_map.json @@ -841,7 +841,7 @@ "expected_results": { "scanlator_name": "ataraxia", "manga_url": "https://www.beyondtheataraxia.com/manga/new-game/", - "completed": true, + "completed": false, "title": "New Game!", "manga_id": "default_id_function", "use_default_id_function": true,