fixed arms 100 convert limit

pull/240/head
meisnate12 4 years ago
parent b9798c62b5
commit 031d668db3

@ -48,19 +48,27 @@ class Convert:
collect_ids(anidb_ids, "anidb") collect_ids(anidb_ids, "anidb")
collect_ids(mal_ids, "myanimelist") collect_ids(mal_ids, "myanimelist")
converted_ids = [] converted_ids = []
if self.config.Cache:
unconverted_ids = [] unconverted_ids = []
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, update = self.config.Cache.query_anime_map(anime_id, id_type) query_ids, expired = self.config.Cache.query_anime_map(anime_id, id_type)
if not update and query_ids: if query_ids and not expired:
converted_ids.append(query_ids) converted_ids.append(query_ids)
else: else:
unconverted_ids.append({id_type: anime_id}) unconverted_ids.append({id_type: anime_id})
if len(unconverted_ids) == 100:
unconverted_id_sets.append(unconverted_ids)
unconverted_ids = []
else: else:
unconverted_ids = all_ids unconverted_ids.append(anime_dict)
if len(unconverted_ids) == 100:
for anime_ids in self._request(unconverted_ids): unconverted_id_sets.append(unconverted_ids)
unconverted_ids = []
for unconverted_id_set in unconverted_id_sets:
for anime_ids in self._request(unconverted_id_set):
if anime_ids: if anime_ids:
if self.config.Cache: if self.config.Cache:
self.config.Cache.update_anime_map(False, anime_ids) self.config.Cache.update_anime_map(False, anime_ids)

@ -92,7 +92,7 @@ util.centered("| |_) | |/ _ \\ \\/ / | |\\/| |/ _ \\ __/ _` | | |\\/| |/ _` | '_
util.centered("| __/| | __/> < | | | | __/ || (_| | | | | | (_| | | | | (_| | (_| | __/ | ") util.centered("| __/| | __/> < | | | | __/ || (_| | | | | | (_| | | | | (_| | (_| | __/ | ")
util.centered("|_| |_|\\___/_/\\_\\ |_| |_|\\___|\\__\\__,_| |_| |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_| ") util.centered("|_| |_|\\___/_/\\_\\ |_| |_|\\___|\\__\\__,_| |_| |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_| ")
util.centered(" |___/ ") util.centered(" |___/ ")
util.centered(" Version: 1.9.0-beta2 ") util.centered(" Version: 1.9.0-beta3 ")
util.separator() util.separator()
def start(config_path, is_test, daily, requested_collections, requested_libraries, resume_from): def start(config_path, is_test, daily, requested_collections, requested_libraries, resume_from):

Loading…
Cancel
Save