diff options
| author | Fuwn <[email protected]> | 2023-07-25 13:43:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-07-25 13:43:41 -0700 |
| commit | e1c84d6cf9f6c8693ed1d20bd35ea7bded0c4a3c (patch) | |
| tree | 238c0312b42f956d15963ec4595e0367f14a70fe /src | |
| parent | feat(cache): raise cache timeout (diff) | |
| download | old.due.moe-e1c84d6cf9f6c8693ed1d20bd35ea7bded0c4a3c.tar.xz old.due.moe-e1c84d6cf9f6c8693ed1d20bd35ea7bded0c4a3c.zip | |
fix(index): timing sources
Diffstat (limited to 'src')
| -rw-r--r-- | src/due/routes/index.py | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/due/routes/index.py b/src/due/routes/index.py index d73bf31..b58aec0 100644 --- a/src/due/routes/index.py +++ b/src/due/routes/index.py @@ -21,24 +21,9 @@ def home(): anilist = json.loads(request.cookies.get("anilist")) start = time.time() (current_anime, name) = create_collection(anilist, "ANIME") - anime_time = time.time() - start - start = time.time() - (current_manga, _) = create_collection(anilist, "MANGA") - manga_time = time.time() - start - releasing_anime = [ media for media in current_anime if media["media"]["status"] == "RELEASING" ] - releasing_manga = [ - media for media in current_manga if media["media"]["status"] == "RELEASING" - ] - releasing_outdated_manga = [ - media - for media in releasing_manga - if media["media"]["type"] == "MANGA" - and int(media["media"]["mediaListEntry"]["progress"]) - >= 1 # Useful when testing - ] releasing_outdated_anime = [ media for media in releasing_anime @@ -54,7 +39,21 @@ def home(): != int(media["media"]["mediaListEntry"]["progress"]) ] (anime_html, anime_length) = anime_to_html(releasing_outdated_anime) + anime_time = time.time() - start + start = time.time() + (current_manga, _) = create_collection(anilist, "MANGA") + releasing_manga = [ + media for media in current_manga if media["media"]["status"] == "RELEASING" + ] + releasing_outdated_manga = [ + media + for media in releasing_manga + if media["media"]["type"] == "MANGA" + and int(media["media"]["mediaListEntry"]["progress"]) + >= 1 # Useful when testing + ] (manga_html, manga_length) = manga_to_html(releasing_outdated_manga) + manga_time = time.time() - start response.set_data( page( |