diff options
| author | Fuwn <[email protected]> | 2023-07-25 15:55:24 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-07-25 15:55:24 -0700 |
| commit | e043fd7f4ace83a5dbecd5b3930e39d1802c14ba (patch) | |
| tree | 8adcef2efb1227cb165501a4d190b7933b829be2 /src/due/html.py | |
| parent | fix(html): fix more manga title cases (diff) | |
| download | old.due.moe-e043fd7f4ace83a5dbecd5b3930e39d1802c14ba.tar.xz old.due.moe-e043fd7f4ace83a5dbecd5b3930e39d1802c14ba.zip | |
fix(html): fix anime id cases
Diffstat (limited to 'src/due/html.py')
| -rw-r--r-- | src/due/html.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/due/html.py b/src/due/html.py index ae8ae2c..eba7e8b 100644 --- a/src/due/html.py +++ b/src/due/html.py @@ -7,18 +7,18 @@ import math def anime_to_html(releasing_outdated_anime): current_html = "<ul>" - titles = [] + ids = [] for media in releasing_outdated_anime: anime = media["media"] title = anime["title"]["english"] + id = anime["id"] - if title in titles: - continue + if id in ids: + return else: - titles.append(title) + ids.append(id) - id = anime["id"] progress = anime["mediaListEntry"]["progress"] available = ( {"episode": 0} @@ -34,7 +34,7 @@ def anime_to_html(releasing_outdated_anime): current_html += f'<li><a href="https://anilist.co/anime/{id}" target="_blank">{title}</a> {progress} [{available}]</li>' - return (current_html + "</ul>", len(titles)) + return (current_html + "</ul>", len(ids)) def manga_to_html(releasing_outdated_manga): @@ -44,13 +44,13 @@ def manga_to_html(releasing_outdated_manga): def process(media): manga = media["media"] title = manga["title"]["english"] + id = manga["id"] - if manga["id"] in ids: + if id in ids: return else: - ids.append(manga["id"]) + ids.append(id) - id = manga["id"] progress = manga["mediaListEntry"]["progress"] available = ( {"episode": 0} |