Show Current size When Download size Exceeded. (#51)

* Show Current size When Download  size Exceeded.

* Fix typo

Co-authored-by: Hafitz Setya <71178188+breakdowns@users.noreply.github.com>
This commit is contained in:
BruteWoorse 2021-04-15 20:21:12 +08:00 committed by GitHub
parent 4fa3f74a36
commit 8f937c1b1f
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,10 +22,11 @@ class AriaDownloadHelper(DownloadHelper):
download = api.get_download(gid)
self.name = download.name
sname = download.name
size = download.total_length
if ENABLE_FILESIZE_LIMIT:
if download.total_length / 1024 / 1024 / 1024 > MAX_TORRENT_SIZE:
if size / 1024 / 1024 / 1024 > MAX_TORRENT_SIZE:
LOGGER.info(f" Download size Exceeded: {gid}")
dl.getListener().onDownloadError(f'File size larger than Maximum Allowed size {MAX_TORRENT_SIZE}GB')
dl.getListener().onDownloadError(f'File size {get_readable_file_size(size)} larger than Maximum Allowed size {MAX_TORRENT_SIZE}')
aria2.remove([download])
return
update_all_messages()