fix: 修复配置常量问题

This commit is contained in:
dnslin
2025-12-12 08:47:13 +08:00
parent 342aef7e1e
commit b24e6c0c80
3 changed files with 12 additions and 0 deletions

View File

@@ -17,6 +17,8 @@ from src.core import (
ARIA2_BIN,
ARIA2_CONFIG_DIR,
ARIA2_CONF,
ARIA2_DHT,
ARIA2_DHT6,
ARIA2_LOG,
ARIA2_SESSION,
Aria2Config,
@@ -175,6 +177,10 @@ class Aria2Installer:
"rpc-secret=": rpc_secret,
"max-concurrent-downloads=": str(self.config.max_concurrent_downloads),
"max-connection-per-server=": str(self.config.max_connection_per_server),
"dht-file-path=": str(ARIA2_DHT),
"dht-file-path6=": str(ARIA2_DHT6),
"input-file=": str(ARIA2_SESSION),
"save-session=": str(ARIA2_SESSION),
}
logger.info(f"配置参数: RPC端口={self.config.rpc_port}, 下载目录={self.config.download_dir}")

View File

@@ -6,6 +6,8 @@ from src.core.constants import (
ARIA2_CONF,
ARIA2_SESSION,
ARIA2_LOG,
ARIA2_DHT,
ARIA2_DHT6,
DOWNLOAD_DIR,
SYSTEMD_USER_DIR,
ARIA2_SERVICE,
@@ -35,6 +37,8 @@ __all__ = [
"ARIA2_CONF",
"ARIA2_SESSION",
"ARIA2_LOG",
"ARIA2_DHT",
"ARIA2_DHT6",
"DOWNLOAD_DIR",
"SYSTEMD_USER_DIR",
"ARIA2_SERVICE",

View File

@@ -7,6 +7,8 @@ ARIA2_CONFIG_DIR = HOME / ".config" / "aria2"
ARIA2_CONF = ARIA2_CONFIG_DIR / "aria2.conf"
ARIA2_SESSION = ARIA2_CONFIG_DIR / "aria2.session"
ARIA2_LOG = ARIA2_CONFIG_DIR / "aria2.log"
ARIA2_DHT = ARIA2_CONFIG_DIR / "dht.dat"
ARIA2_DHT6 = ARIA2_CONFIG_DIR / "dht6.dat"
DOWNLOAD_DIR = HOME / "downloads"
SYSTEMD_USER_DIR = HOME / ".config" / "systemd" / "user"
ARIA2_SERVICE = SYSTEMD_USER_DIR / "aria2.service"