Downloaded Folder Not deleted when importing transcoded file

@imadunatic I am pretty sure I can do it similarly to how you are doing. All I really have to do is tell it not to transcode somewhere else. But that route isn’t clean but doable. I can try that for now until @Taloth come up with a fix.

@Taloth No worries. Definitely not priority. I am sure you have plenty in your plate.

@Taloth @imadunatic @markus101 I disabled the outputVideoPath setting in nzbget for nzbtonzbdrone script for now. The file still gets transcoded but instead of using a different directory for transcoding, it uses the same download dir.

@breezytm Can you check out the latest dev version (.3099)?

There was an error that was causing the Remove logic to be triggered after import but before nzbget finished processing. At that point we don’t get the download path yet, hence the failure.

@Taloth Just to be clear, in sonarr I also need to enable “Remove” the history in nzbget to test this update. Correct?

Yes, the logic that removes from history also removes the files. For sabnzbd (and every other client) the client does that for us, but for nzbget we have to do it ourselves.

@Taloth Ok. I will give it a try and report back.

Just so we are all on the same page, if outputvideoPath is disabled nzbget, just like all other download clients, will delete the leftovers This fix you just implemented will now make sure sonarr deletes the leftovers when outputVideoPath is enable or disable.

@Taloth The folder did not get deleted. It’s just empty. Timing issue still perhaps.

The file I downloaded was
Bsg-s01E09-germandubbed-dl-720p-hddvd-x264
Bsg-s01E10-germandubbed-dl-720p-hddvd-x264

Worst possible example ever, fails because of a totally different reason. :smiley:

15-5-5 20:15:56.2|Debug|TrackedDownloadService|Failed to find episode for Bsg-s01E09-germandubbed-dl-720p-hddvd-x264

System.ApplicationException: Expected query to return 2 rows but returned 1
  at NzbDrone.Core.Datastore.BasicRepository`1[NzbDrone.Core.Tv.Episode].Get (IEnumerable`1 ids) [0x00071] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Datastore\BasicRepository.cs:97 
  at NzbDrone.Core.Tv.EpisodeService.GetEpisodes (IEnumerable`1 ids) [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Tv\EpisodeService.cs:63 
  at NzbDrone.Core.Parser.ParsingService.Map (NzbDrone.Core.Parser.Model.ParsedEpisodeInfo parsedEpisodeInfo, Int32 seriesId, IEnumerable`1 episodeIds) [0x00000] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Parser\ParsingService.cs:141 
  at NzbDrone.Core.Download.TrackedDownloads.TrackedDownloadService.TrackDownload (NzbDrone.Core.Download.DownloadClientDefinition downloadClient, NzbDrone.Core.Download.DownloadClientItem downloadItem) [0x000b1] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Download\TrackedDownloads\TrackedDownloadService.cs:73 

@breezytm Can you check your History see what release name it was grabbed as?
Also restart Sonarr. See if that error keeps getting logged.

@markus101 See above exception, keeps repeating in the log forever. Any idea what this could be? Checked my own db, episodeids didn’t change since April, so can’t be a caching issue. Weird that it’s expecting two episodes. My only guess is that the parser doesn’t like ‘bsg’ (not a known series) and falls back to the episode numbers from the grab.

I think your theory is correct. It sounds like it was linked to multiple episodes when it was grabbed, but one of those episodes is no longer in the DB.

Knowing whats in the History table in DB for that release would certainly help, as Taloth suggested.

@Taloth @markus101 Sorry guys i’ve been pretty tight up. Maybe I can explain what happened here a little. Hopefully that can clear out some things.

Last time when I downloaded two episodes of Battlestar Galactica; the nzb sonarr grabbed were .avi files. As I mentioned earlier, .AVI files in my nzbget config does ignores avi files and it doesn’t transcode them. When I made the search it grabbed an nzb file from the same newsgroup. I manually went to sonarr and selected a different nzb which I knew would be mkv since I know the newsgroup pretty well. That might explain why it’s expecting two episodes.

Sonar grabbed an nzb file automatically. I deleted it from nzbget queue and manually selected one from sonarr for download. The downloads were post-processed and moved to the correct directory successfully.

I have sonarr logging still running in debug mode. Here’s the latest log I downloaded as well as the only show downloaded from my calendar for today.

Nashville.2012.S03E21.720p.HDTV.x264-IMMERSE

No, sonarr tracks different nzbs separately.

You really need to look in Activity->History, find the ‘Grabbed’ history events for bsg. Click on the ‘i’ icons on the far right to get a popup with details, we need those details.

Grabbed
Name:
Bsg-s01E10-germandubbed-dl-720p-hddvd-x264
Indexer:
Usenet-Crawler
Release Group:
x264
Info:
https://www.usenet-crawler.com/details/8181a92733d1a54852d7ebd54e2f1be8
Download Client:
Nzbget
Age (when grabbed):
1943 days
Published Date:
Jan 8 2010 6:20:10am

Grabbed
Name:
Bsg-s01E09-germandubbed-dl-720p-hddvd-x264
Indexer:
Usenet-Crawler
Release Group:
x264
Info:
https://www.usenet-crawler.com/details/e5133224f861fd648aeef1023299910d
Download Client:
Nzbget
Age (when grabbed):
1943 days
Published Date:
Jan 8 2010 6:15:24am

@Taloth sorry dude . Crazy week for me.