V3 and trigger manual import from qBittorrent


#1

Sonarr version (exact version): 3.0.0.348
OS: Windows 10
Description of issue:

I’ve been using qBittorrent with a custom post processing script and Sonarr v2 for a couple of years now. I use the custom post processing script because most of the downloaded episodes are split into .rar files. The script extracts the episode and moves the file to a temp folder on my NAS. The script then calls Sonarr through the API with this command:

"C:\Program Files (x86)\cURL\curl.exe" http://localhost:3533/api/command -X POST -d "{'name': 'DownloadedEpisodesScan' , 'path': 'S:\\-=PostProcessingTemp=-\\-=Sonarr=-', 'importMode': 'Move', 'downloadClientId': '[Torrent-hash]'}" --header "X-Api-Key:[MY API KEY]"

Sonarr would then import the episode from the temp folder. This worked great in v2.

In v3 it seems like the episode needs to be located in either the download folder (the folder that qBittorent uses) or a sub-folder in order to be imported using the command above. If I try to import the file from my temp folder on my NAS like I usually do, it simple won’t work.

From the log file

[v3.0.0.348] NzbDrone.Common.Disk.NotParentException: S:\-=PostProcessingTemp=-\SonarrTemp\The.Blacklist.S06E02.720p.WEB.H264-AMCON.mkv is not a child of E:\-=DVDR=-\-=Sonarr=-\
   vid NzbDrone.Common.Extensions.PathExtensions.GetRelativePath(String parentPath, String childPath) i M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Common\Extensions\PathExtensions.cs:rad 62
   vid NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.GetOriginalFilePath(DownloadClientItem downloadClientItem, LocalEpisode localEpisode) i M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\MediaFiles\EpisodeImport\ImportApprovedEpisodes.cs:rad 165
   vid NzbDrone.Core.MediaFiles.EpisodeImport.ImportApprovedEpisodes.Import(List`1 decisions, Boolean newDownload, DownloadClientItem downloadClientItem, ImportMode importMode) i M:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\MediaFiles\EpisodeImport\ImportApprovedEpisodes.cs:rad 108

Is there a reason for changing this behavior in v3?

Would it be possible to allow imports from a folder that aren’t “a child of” the download folder?


#2

This is a bug, I’ll take a look at it.

You should be using a job folder for the imports though, something like: S:\\-=PostProcessingTemp=-\\-=Sonarr=-\Series.Title.S01E01.xyz

A folder specified by the path variable is assumed to be a single download (job) and the folder name should be the release name.


#3

Great, thank you! :grinning:


closed #4

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.