Skip to content

Commit

Permalink
Add Status Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 committed Apr 17, 2024
1 parent ee3de99 commit 0f84b39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion update_anime_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{"arg": "tr", "key": "trace", "env": "TRACE", "type": "bool", "default": False, "help": "Run with extra trace logs."},
{"arg": "lr", "key": "log-requests", "env": "LOG_REQUESTS", "type": "bool", "default": False, "help": "Run with every request logged."}
]
script_name = "PMM Anime IDs"
script_name = "Anime IDs"
base_dir = os.path.dirname(os.path.abspath(__file__))
args = KometaArgs("Kometa-Team/Anime-IDs", base_dir, options, use_nightly=False)
logger = KometaLogger(script_name, "anime_ids", os.path.join(base_dir, "logs"), is_trace=args["trace"], log_requests=args["log-requests"])
Expand All @@ -32,6 +32,7 @@

anime_dicts = {}

logger.info("Scanning Anime-Lists")
for anime in AniDBIDs.xpath("//anime"):
anidb_id = str(anime.xpath("@anidbid")[0])
if not anidb_id:
Expand Down Expand Up @@ -62,6 +63,7 @@
anime_dict["imdb_id"] = imdb_id
anime_dicts[anidb_id] = anime_dict

logger.info("Scanning Manami-Project")
for anime in Manami["data"]:
if "sources" not in anime:
continue
Expand All @@ -82,6 +84,7 @@
if anilist_id:
anime_dicts[anidb_id]["anilist_id"] = anilist_id

logger.info("Scanning Anime ID Edits")
with open("anime_id_edits.json", "r") as f:
for anidb_id, ids in json.load(f).items():
anidb_id = int(anidb_id)
Expand All @@ -90,6 +93,7 @@
if attr in ids:
anime_dicts[anidb_id][attr] = ids[attr]

logger.info("Saving Anime IDs")
with open("anime_ids.json", "w") as write:
json.dump(anime_dicts, write, indent=2)

Expand All @@ -102,3 +106,5 @@

with open("README.md", "w") as f:
f.writelines(data)

logger.separator(f"{script_name} Finished\nTotal Runtime: {logger.runtime()}")

0 comments on commit 0f84b39

Please sign in to comment.