fix: retain last non-empty result set in search polling loop

DSM sends files=[] on the final finished=True poll even when results
exist in earlier rounds. Overwriting files each iteration discarded
the real results, producing a false "No files found" response.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-14 09:48:05 +02:00
parent c47221dc8f
commit 544cfb8b06
2 changed files with 38 additions and 1 deletions
@@ -287,7 +287,9 @@ def register_filestation(
)
return f"Error: {e}"
files = poll_data.get("files", [])
current_files: list[dict] = poll_data.get("files", [])
if current_files:
files = current_files # keep the last non-empty result set
finished: bool = poll_data.get("finished", False)
if finished: