mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b51552313 | |||
| cac2ad3ab1 | |||
| cdbf9165d2 |
@@ -95,7 +95,7 @@ jobs:
|
||||
run: |
|
||||
python -c "
|
||||
from PIL import Image
|
||||
img = Image.open('src/core/interface/assets/logo.png')
|
||||
img = Image.open('src/interface/assets/logo.png')
|
||||
img.save('app_icon.ico', format='ICO', sizes=[(256,256),(128,128),(64,64),(48,48),(32,32),(16,16)])
|
||||
print('Icon converted successfully')
|
||||
"
|
||||
|
||||
@@ -62,7 +62,6 @@ SoftwareManager is a Python-based GUI tool that simplifies searching and downloa
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=KeksPirates/SoftwareManager&type=date&legend=top-left" />
|
||||
</picture>
|
||||
</a>
|
||||
---
|
||||
|
||||
**Disclaimer:** SoftwareManager is intended for legal and ethical use only. Ensure compliance with applicable laws and regulations when using this tool.
|
||||
|
||||
|
||||
@@ -21,6 +21,25 @@ def get_free_space_mb(dirname):
|
||||
st = os.statvfs(dirname)
|
||||
return st.f_bavail * st.f_frsize
|
||||
|
||||
def check_space():
|
||||
while not state.shutdown_event.is_set():
|
||||
for magnet_uri, magnetdl in list(state.active_downloads.items()):
|
||||
try:
|
||||
status = magnetdl.status()
|
||||
except RuntimeError:
|
||||
continue
|
||||
|
||||
if status.state == lt.torrent_status.downloading:
|
||||
free_space = get_free_space_mb(state.download_path)
|
||||
total_size = status.total_wanted
|
||||
|
||||
if free_space < total_size:
|
||||
consoleLog(f"Not enough free space to continue downloading: {status.name}")
|
||||
magnetdl.pause()
|
||||
break
|
||||
|
||||
time.sleep(5)
|
||||
|
||||
def init_session():
|
||||
if state.dl_session is not None:
|
||||
return
|
||||
|
||||
+3
-1
@@ -3,6 +3,7 @@ from core.utils.logging.loghandler import split_data, check_completed, check_dow
|
||||
from core.network.interface import list_interfaces, init_interfaces
|
||||
from core.utils.logging.logs import get_download_logs
|
||||
from core.utils.logging.logs import set_main_window
|
||||
from core.network.libtorrent_int import check_space
|
||||
from core.utils.general.shutdown import closehelper
|
||||
from core.utils.general.wrappers import run_thread
|
||||
from core.utils.general.shutdown import force_exit
|
||||
@@ -59,6 +60,7 @@ def main():
|
||||
# Start background non-daemon threads
|
||||
run_thread(threading.Thread(target=check_completed, args=(downloads, state.autoresume)))
|
||||
run_thread(threading.Thread(target=check_downloads, args=(downloads,)))
|
||||
run_thread(threading.Thread(target=check_space, args=()))
|
||||
# Finish counting startup time
|
||||
elapsed = time.perf_counter() - start_time
|
||||
consoleLog(f"Initialization completed in {elapsed:.2f}s. Launching GUI")
|
||||
@@ -66,4 +68,4 @@ def main():
|
||||
run_gui()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user