Use content_path and add savePath/path-wait

Always use qBittorrent's content_path as the canonical downloadPath and expose savePath on DownloadInfo instead of reconstructing paths from save_path + basename. Add path-waiting logic to the monitor: track consecutive pathWaitCount polls, re-queue the monitor with exponential-ish backoff while content_path remains outside save_path (to handle TempPathEnabled races), and give up after a configurable max attempts. Extend the MonitorDownload payload and JobQueue APIs to carry pathWaitCount. Organize-files processor now attempts to refresh the stored downloadPath from the download client and updates downloadHistory if the client reports a different path (applying path mapping). Update tests to reflect the new behavior and expectations.
This commit is contained in:
kikootwo
2026-02-26 12:45:24 -05:00
parent d38f03b8f4
commit 1b0a80052d
6 changed files with 262 additions and 227 deletions
@@ -82,6 +82,8 @@ export interface DownloadInfo {
category: string;
/** Filesystem path where download is stored (available after completion) */
downloadPath?: string;
/** Configured save directory (torrent clients only, used for path readiness detection) */
savePath?: string;
/** When the download completed */
completedAt?: Date;
/** Error message if download failed */