|
|
@ -53,21 +53,18 @@ class Convert:
|
|
|
|
unconverted_id_sets = []
|
|
|
|
unconverted_id_sets = []
|
|
|
|
|
|
|
|
|
|
|
|
for anime_dict in all_ids:
|
|
|
|
for anime_dict in all_ids:
|
|
|
|
if self.config.Cache:
|
|
|
|
for id_type, anime_id in anime_dict.items():
|
|
|
|
for id_type, anime_id in anime_dict.items():
|
|
|
|
query_ids = None
|
|
|
|
|
|
|
|
expired = None
|
|
|
|
|
|
|
|
if self.config.Cache:
|
|
|
|
query_ids, expired = self.config.Cache.query_anime_map(anime_id, id_type)
|
|
|
|
query_ids, expired = self.config.Cache.query_anime_map(anime_id, id_type)
|
|
|
|
if query_ids and not expired:
|
|
|
|
if query_ids and not expired:
|
|
|
|
converted_ids.append(query_ids)
|
|
|
|
converted_ids.append(query_ids)
|
|
|
|
else:
|
|
|
|
if query_ids is None or expired:
|
|
|
|
unconverted_ids.append({id_type: anime_id})
|
|
|
|
unconverted_ids.append(anime_dict)
|
|
|
|
if len(unconverted_ids) == 100:
|
|
|
|
if len(unconverted_ids) == 100:
|
|
|
|
unconverted_id_sets.append(unconverted_ids)
|
|
|
|
unconverted_id_sets.append(unconverted_ids)
|
|
|
|
unconverted_ids = []
|
|
|
|
unconverted_ids = []
|
|
|
|
else:
|
|
|
|
|
|
|
|
unconverted_ids.append(anime_dict)
|
|
|
|
|
|
|
|
if len(unconverted_ids) == 100:
|
|
|
|
|
|
|
|
unconverted_id_sets.append(unconverted_ids)
|
|
|
|
|
|
|
|
unconverted_ids = []
|
|
|
|
|
|
|
|
if len(unconverted_ids) > 0:
|
|
|
|
if len(unconverted_ids) > 0:
|
|
|
|
unconverted_id_sets.append(unconverted_ids)
|
|
|
|
unconverted_id_sets.append(unconverted_ids)
|
|
|
|
for unconverted_id_set in unconverted_id_sets:
|
|
|
|
for unconverted_id_set in unconverted_id_sets:
|
|
|
|