Skip to content

Commit 679eef4

Browse files
authored
Merge pull request #4 from Mino-shiro/anidb-fix
Anidb fix
2 parents ad3e4ab + 63dc61d commit 679eef4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.8
1+
0.1.9

minoshiro/minoshiro.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,14 @@ async def __fetch_anidb(self):
298298
)
299299

300300
if not good or not self.__anidb_list:
301-
self.logger.info('Reading anidb data from disk...')
302-
with dump_path.open() as xml_file:
303-
xml = xml_file.read()
304-
self.__anidb_list = ani_db.process_xml(xml)
305-
self.logger.info('Anidb data read from disk.')
301+
try:
302+
self.logger.info('Reading anidb data from disk...')
303+
with dump_path.open() as xml_file:
304+
xml = xml_file.read()
305+
self.__anidb_list = ani_db.process_xml(xml)
306+
self.logger.info('Anidb data read from disk.')
307+
except Exception as e:
308+
self.logger.warn(f'Error loading anidb data from disk: {e}')
306309
self.__anidb_time = new_time
307310

308311
async def __find_anilist(self, cached_data, cached_ids,
@@ -434,7 +437,7 @@ async def __find_anidb(self, cached_ids, medium, query):
434437
return {'url': f'{base_url}{cached_id}'}, cached_id
435438
await self.__fetch_anidb()
436439
res = await self.loop.run_in_executor(
437-
None, ani_db.get_anime, query, self.__anidb_list
440+
None, ani_db.get_animeani_db.get_anime, query, self.__anidb_list
438441
)
439442
if not res:
440443
return None, None

0 commit comments

Comments
 (0)