Closed coldner closed 1 year ago
546982c shows the total size before download
The new --check-free-space
option can be used check if there is enough free space and abort if not enough is available
$ lgogdownloader --download --game witcher_2 --directory /tmp/ --check-free-space
Getting game names (3/3) 72 / 72
Getting game info 1 / 1
Total size: 48.19 GB
Not enough free space in "/tmp/" (15.63 GB)
$ lgogdownloader --galaxy-install witcher_2 --directory /tmp/ --check-free-space
Getting game names (3/3) 72 / 72
The Witcher 2 - Assassins of Kings Enhanced Edition
Files: 1725
Total size installed: 22.93 GB
Not enough free space in "/tmp" (15.63 GB)
$ lgogdownloader --download --game tyrian_2000 --include i --directory /tmp/
Getting game names (3/3) 72 / 72
Getting game info 1 / 1
Total size: 18.00 MB
2023-Apr-03 15:01:36 [Thread #0] Download complete: setup_tyrian_2000_3.0_(28045).exe (@ 10.85MB/s)
2023-Apr-03 15:01:36 [Thread #0] Finished all tasks
#0: Finished
--check-free-space
option has a limitation which is why it is not enabled by default.
It will always check for the total size of items to be downloaded.
Example:
User wants to download all of their games. Let's assume that the total size of games on their account is 1TB.
Their HDD has 700 GB of free space.
The user has already downloaded all of their games 2 weeks ago.
There might be couple of games updated so let's say that the total size of new installers is 100GB.
Because --check-free-space
always checks for the total size it will abort because not enough free space is available (700GB free but it assumes 1TB is required although it actually requires only 100GB)
It works like a charm. Tested on a1a7fb4a28d0a136ae16009e12d391638ba6ac3c Thank you very much!
It would be nice to see size sum before batch download. Additional, app can check if all requested files will fit on drive.