Downloaded Folder Not deleted when importing transcoded file

My use case for this is a little different as the problem only occurs Torrent based. NZBGet already removes the sample/sfv/nfo stuff based on what I have setup in NZBGet.

For me, when it finds a Torrent, it drops does:

Sonarr - Finds a torrent -> Blackhole
Blackhole->BTSync->Seedbox
Seedbox finishes torrent->BTSync->Sonarr

Cronjon on Sonarr boxes runs NzbToNzbDrone and that processes the ‘done’ btsync folder as NzbToNzbMedia handles any RAR or ignores btsync file.

I also have remove on as well.

@Taloth

Interesting. I left “Remove” disabled because I didn’t want to delete the record of my history. NZBGet is scheduled to do so automatically every 7 days anyway. The main cause of keep the history is because sometimes when my colleagues have failed downloads I wouldlook through my history and tell them which ones to manually download.

With Remove disabled, Sonarr + NzbGet work just fine… Are you saying enabling it is only useful when nzbToMedia, which is transcoding, is introduced?

If that is the case, I can enable it and see if it makes a difference. But if that is really the case I can’t keep my history.

@breezytm Sonarr History contains the release name as well, in case you need it.
The item is also still visible in NzbGet history, but you have to turn on the Hidden in the same UI.

@depraved22 With that workflow you entirely bypass the Completed Download Handling. So no wonder that behaves differently.
But it isn’t the same issue, your problem is that sonarr thinks that file is not sample file.
You should enable Debug logging, see what the detectsample logic says/logs in the logfile during the next import.

@Taloth I will give that a try tonight and let you know if it works for me. I enabled it in the past during troubleshooting to make sure I covered everything but it didn’t seem to make a difference. According to your previous comment, I need to wait 1 minute after post-processing is successfully completed. Correct?

Yes, CDH checks the NzbGet API every minute. Lemme know if it doesn’t work, coz then i’ll have to fire up nzbToMedia here.

@Taloth As expected it didn’t make any difference. The only change is it deleted the record from history but folder remains.

@Taloth - Is there a different way you’d recommend to setup the workflow? I’m definitely willing to try different things as I’ve been toying with the idea of SSHFS mounts for the remote filesystems or different ways to make it more efficient. For the short term, I can turn on the debug logging and capture my next failure. Thanks.

@breezytm Think I see the problem… don’t have time to fix that today, but will look into it.

@depraved22 Your workflow isn’t easily ‘fixed’. But focus on finding out why it’s thinking it’s not a sample.

@Taloth sounds good. A fix on the way is good enough for me. Thanks for taking the time to look into it.

develop release v2.0.0.3084 should have the Remove fixed. (still only with Remove enabled)

1 Like

Thanks @Taloth for the quick fix. I am running Sonarr on a QNap. I updated to the dev branch so hopefully nothing breaks. I will wait for tonight downloads and let you know how things works out.

Update: Works sometimes. Not always.



Yes remove is enable.

You need to give us specifics. Just dumping a log isn’t very helpful.

What didn’t get removed? What directory? When?

@Taloth You are right sir. I thought you could tell through the logs since from the time you updated dev branch until now not much had happened.

5/1/15 10:34 PM Shark Tank - 6x27 - Week 26 [HDTV-720] - Folder left behind
5/2/15 06:34 AM Battlestar Galactica (2003) - 1x06 - Litmus [Bluray-720p] - No folder left
5/2/15 06:42 AM Battlestar Galactica (2003) - 1x07 - Degrees of Separation [Bluray-720p] - No folder left behind
5/2/15 06:48 AM Battlestar Galactica (2003) - 1x08 - Flesh and Bone [Bluray-720p] - No folder left behind
5/2/15 08:08 AM American Crime - 1x09 - Episode Nine [HDTV-720p Proper] - Folder left behind
5/2/15 08:37 AM Battlestar Galactica (2003) - 1x06 - Litmus [Bluray-720p] - Folder left behind

Honestly I don’t think the fix is working at all. The downloads with “no folder left behind” comment were .avi files. .AVI files get excluded so they don’t get transcoded. In cases where the download don’t need transcoded the Drone Factory directory is use by Sonarr.

@breezytm Is there a reason you’re using Nzbget to transcode as opposed to letting nzbtomedia transcode? I am doing the exact same thing (MKV to MP4), except I’m on SABNZBD and I’m not seeing this behavior.

@imadunatic I am pretty sure it is for the same reason you are transcoding mkv to mp4. The only difference is my download client is nzbget not sab.

Do you mind sending me a copy of your nzbtomedia script?

@breezytm, Do you just want my CFG file for nzbtomedia? I can strip out my API’s and send it to you…

Edit: To clarify, I understand why you’re transcoding, I was just wondering if there was a reason that you’re not having nzbtomedia transcode (remux) the files with ffmpeg as opposed to NZBGet… Obviously SAB doesn’t give me the option of transcoding and I’m not familiar with NZBGet.

@imadunatic I don’t honestly think there is a difference between the way I do it and the way you do it. I think it’s just a matter of how the download client handles the transcoding process.

NzbGet transcodes the file in a different directory and passes that directory to sonarr to post-process. Sonarr doesn’t know about the download folder. I’ve used sab in the past and I am pretty sure sab does the transcoding in the same download folder. I used to remux my mkv in sab. If Sonarr is aware of the donwload folder it will delete without any issues. It’s just in my case it doesn’t know about it. If I disable transcoding, sonarr would delete all leftovers successfully.

@breezytm, You’re right. When using nzbtomedia with SAB the transcoding occurs in the same completed job folder, not in a different directory and then nzbtomedia cleans up the leftover files and calls Sonarr to rename/move etc, so there is no second folder to clean up in my case.

Is it possible to setup Nzbget to transcode in the same folder rather than in a “transcode” directory? Or can you disable transcoding in NZBget and let nzbtomedia take care of all of it? Clinton is super helpful in figuring out config issues if you post on his github page…

Sorry I couldn’t look into this again earlier, think I know what might be going wrong with the Remove event, it’s being triggered too early.
That’s also where the error in the log comes from.

It will take me a bit more time to think of a solution and actually test it.