retrieving URL file size correctly | improving downloaded file size format

This commit is contained in:
Vinicius Moreira
2019-10-09 15:01:46 -03:00
parent ec12bbb1de
commit 6132155614
9 changed files with 35 additions and 14 deletions

View File

@@ -199,7 +199,14 @@ class AppImageManager(SoftwareManager):
pass
def get_info(self, pkg: AppImage) -> dict:
return pkg.get_data_to_cache()
data = pkg.get_data_to_cache()
if data.get('url_download'):
size = self.http_client.get_content_length(data['url_download'])
if size:
data['size'] = size
return data
def get_history(self, pkg: AppImage) -> PackageHistory:
history = []