fix md5 not available

This commit is contained in:
Fusselkater 2022-11-27 20:07:20 +01:00
parent 875b47700f
commit 0d99fcdcbc

View file

@ -82,8 +82,7 @@ class GameHandler:
for chunk in r.iter_content(chunk_size=8192): for chunk in r.iter_content(chunk_size=8192):
f.write(chunk) f.write(chunk)
md5.update(chunk) md5.update(chunk)
if 'md5_hash' in upload and md5.hexdigest() != upload['md5_hash']:
if md5.hexdigest() != upload['md5_hash']:
raise HandlerException('Invalid checksum') raise HandlerException('Invalid checksum')
return (dst, upload, meta) return (dst, upload, meta)
@ -91,7 +90,7 @@ class GameHandler:
def list_local(self, games): def list_local(self, games):
table = PrettyTable(header=True, align='l', autowrap=False) table = PrettyTable(header=True, align='l', autowrap=False)
table.field_names = ['ID', 'Title', 'Description', 'URL', 'Last update', 'Instllation path'] table.field_names = ['ID', 'Title', 'Description', 'URL', 'Last update', 'Installation path']
for id, game in games.items(): for id, game in games.items():
table.add_row([ table.add_row([