diff --git a/core/downloads/post_processing.py b/core/downloads/post_processing.py index 5dbbae97..2be79eba 100644 --- a/core/downloads/post_processing.py +++ b/core/downloads/post_processing.py @@ -453,7 +453,19 @@ def run_post_processing_worker(task_id: str, batch_id: str, deps: PostProcessDep logger.error(f"[Post-Processing] Task {task_id} was completed by stream processor - not marking as failed") return download_tasks[task_id]['status'] = 'failed' - download_tasks[task_id]['error_message'] = f'File not found on disk after {_file_search_max_retries} search attempts. Expected: {os.path.basename(task_filename)}' + # slskd reported the transfer complete, but the finder never located + # the file under the configured download folder. Name the folder we + # searched and the two real causes — "still being written" (timing) + # or "SoulSync's download path doesn't match slskd's" (the classic + # standalone config mismatch) — so the user can self-diagnose instead + # of getting an opaque "not found". (Discord: Shdjfgatdif.) + _searched_name = os.path.basename((task_filename or '').replace('\\', '/')) or task_filename + download_tasks[task_id]['error_message'] = ( + f"slskd reported '{_searched_name}' downloaded, but it never appeared " + f"under the download folder ({download_dir}) after {_file_search_max_retries} " + f"checks. Either it's still being written, or SoulSync's download path " + f"doesn't match slskd's download directory — they must point at the same folder." + ) deps.on_download_completed(batch_id, task_id, False) return diff --git a/tests/downloads/test_downloads_post_processing.py b/tests/downloads/test_downloads_post_processing.py index 701c6e2b..c8ca26b4 100644 --- a/tests/downloads/test_downloads_post_processing.py +++ b/tests/downloads/test_downloads_post_processing.py @@ -170,7 +170,12 @@ def test_file_not_found_after_retries_marks_failed(monkeypatch): deps, rec = _build_deps() pp.run_post_processing_worker('t1', 'b1', deps) assert download_tasks['t1']['status'] == 'failed' - assert 'File not found on disk' in download_tasks['t1']['error_message'] + # Actionable failure: names the folder searched + the two real causes, so a + # standalone user with a path mismatch can self-diagnose (Discord: Shdjfgatdif). + msg = download_tasks['t1']['error_message'] + assert './downloads' in msg # the folder we actually searched + assert "download path doesn't match slskd" in msg # the config-mismatch hint + assert 'song.flac' in msg # the file slskd reported assert ('on_complete', ('b1', 't1', False), {}) in rec.calls