fix: resolve per-torrent qb save paths
This commit is contained in:
@@ -27,10 +27,16 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||
parser.add_argument("--check-config", action="store_true")
|
||||
arguments = parser.parse_args(argv)
|
||||
config = ClientConfig.load(arguments.config, arguments.mode)
|
||||
qb_extra_roots = tuple(sorted({
|
||||
root
|
||||
for _, root in config.qbittorrent.local_path_overrides
|
||||
if root != config.qbittorrent.local_root
|
||||
}))
|
||||
probes = [
|
||||
probe_root(config.qbittorrent.local_root),
|
||||
probe_root(config.syncthing.local_root),
|
||||
]
|
||||
qb_extra_probes = tuple(probe_root(root) for root in qb_extra_roots)
|
||||
probe_writable_directory(config.state_db.parent)
|
||||
probe_writable_directory(config.backup_dir)
|
||||
shared_token = config.read_shared_token()
|
||||
@@ -40,7 +46,10 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||
print(json.dumps({
|
||||
"client_id": config.client_id,
|
||||
"role": config.role,
|
||||
"filesystems": [probe.__dict__ | {"root": str(probe.root)} for probe in probes],
|
||||
"filesystems": [
|
||||
probe.__dict__ | {"root": str(probe.root)}
|
||||
for probe in (*probes[:1], *qb_extra_probes, *probes[1:])
|
||||
],
|
||||
}, sort_keys=True))
|
||||
return 0
|
||||
configure_logging(
|
||||
@@ -68,7 +77,7 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||
},
|
||||
)
|
||||
asyncio.run(ArchiveClientDaemon(
|
||||
config, probes, service_probes,
|
||||
config, probes, service_probes, qb_extra_probes=qb_extra_probes,
|
||||
resource_reader=QBittorrentReader(config.qbittorrent),
|
||||
).run())
|
||||
except KeyboardInterrupt:
|
||||
|
||||
Reference in New Issue
Block a user