Summary
With NZBGet (separate InterDir configured), every completed download fails to import. Files land in completed/, but Listenarr keeps scanning the intermediate/<name>.#NZBID working dir — which is deleted after completion — so it never imports and the Activity entry stays stuck. No remote path mapping (so not #486).
Environment
- Listenarr
canary (reproduced on HEAD / v1.0.6)
- NZBGet (LinuxServer):
DestDir=.../completed, InterDir=.../intermediate
- Listenarr + NZBGet share
/data:/data; no remote path mapping
- Deterministic, reproduced on 4 titles
Symptom
[WRN] DownloadClientGateway: reported no source files and content path scanning failed
for item Brian.Jacques-Redwall.21-The.Sable.Quean... with path
/data/downloads/nzbget/intermediate/...#125/...
File is actually at /data/downloads/nzbget/completed/.../The Sable Quean.m4b.
Root cause
GetImportItemAsync (listenarr.infrastructure/Adapters/NzbgetAdapter.cs, ~line 1032) returns early on a non-empty ContentPath without checking it exists:
// If ContentPath is already set and exists, use it
if (!string.IsNullOrEmpty(result.ContentPath))
{
return result;
}
The comment says "and exists," but there's no existence check. MapGroup (~line 755) has already set ContentPath from the active group's DestDir, which for an in-progress NZBGet group is the intermediate working dir. So this early return hands back the stale path and the history FinalDir/DestDir resolution just below (~lines 1063–1065) never runs. After completion the intermediate dir is gone, the gateway's Directory.EnumerateFiles throws, and import fails.
Fix
if (!string.IsNullOrEmpty(result.ContentPath) &&
(File.Exists(result.ContentPath) || Directory.Exists(result.ContentPath)))
{
return result;
}
Now the stale path fails the guard, execution falls through to the history lookup, ContentPath resolves to completed/<name>, and import proceeds.
Note: clearing InterDir is not a workaround — NZBGet still uses a .#NZBID temp dir that's renamed on completion, so the early return still returns a stale path.
Summary
With NZBGet (separate
InterDirconfigured), every completed download fails to import. Files land incompleted/, but Listenarr keeps scanning theintermediate/<name>.#NZBIDworking dir — which is deleted after completion — so it never imports and the Activity entry stays stuck. No remote path mapping (so not #486).Environment
canary(reproduced on HEAD / v1.0.6)DestDir=.../completed,InterDir=.../intermediate/data:/data; no remote path mappingSymptom
File is actually at
/data/downloads/nzbget/completed/.../The Sable Quean.m4b.Root cause
GetImportItemAsync(listenarr.infrastructure/Adapters/NzbgetAdapter.cs, ~line 1032) returns early on a non-emptyContentPathwithout checking it exists:The comment says "and exists," but there's no existence check.
MapGroup(~line 755) has already setContentPathfrom the active group'sDestDir, which for an in-progress NZBGet group is the intermediate working dir. So this early return hands back the stale path and the historyFinalDir/DestDirresolution just below (~lines 1063–1065) never runs. After completion the intermediate dir is gone, the gateway'sDirectory.EnumerateFilesthrows, and import fails.Fix
Now the stale path fails the guard, execution falls through to the history lookup,
ContentPathresolves tocompleted/<name>, and import proceeds.Note: clearing
InterDiris not a workaround — NZBGet still uses a.#NZBIDtemp dir that's renamed on completion, so the early return still returns a stale path.