I have recently rediscovered Usenet downloading after using BT almost exclusively for a few years.
When I tried Usenet downloading through NZB a while back I used NZB-O-Matic Plus, which works great but of course only does downloading, while sabnzbd does so much more.
One annoyance I encountered with sabnzbd however is that it puts the contents of every downloaded NZB file in it's own subfolder in your download folder. As I mostly download single MKV/AVI files as single NZB files that get's annoying because you end up with lots of folders with 1 file in it.
Now I'm not sure if anyone already wrote a script that solves this issue, but if there isn't one yet, here is the one I wrote:
Code: Select all
@echo off
for /f "tokens=*" %%c in ('dir/b/a-d %1 ^| find /v /c "::"') do set filecount=%%c
if %filecount% LEQ 5 (
cd /d %1
for /f "tokens=*" %%f in ('dir /a-d /b') do if not exist "..\%%f" (
echo Moving %%f...
move "%%f" ".."
)
cd ..
echo Deleting folder...
rd %1
) else (
echo To many files to move, aborting...
)
Basically this script will count the number of files in the subfolder. If there are 5 or less files in the folder, it'll move them to the parent folder (=root download folder). After all files have been moved it tries to remove the subfolder itself (which should be empty).
The effective result is that your root download folder will contain all downloaded files and no subfolders.
The script won't overwrite a file in the root download folder if the file already exists. In that case the duplicate file remains in the subfolder which won't get removed. The reason for the 5 file limit is to avoid moving (and potentially mixing) large collections of files.
Anyway, I'm not sure if anyone else finds this script useful, but I hope you like it.
Update 2011-10-15:
I just noticed the error barlow already noticed that not moving the files when there are more than 5 was not working. I've updated the script above to include his bugfix (thanks!).
Also note:
Finally! Though I'm not sure if I'll use this option in my case as my script (when now fixed at least!) will remove folders from single-file downloads but will leave multi-file downloads in folders. I suspect this option will simply not use folders for anything at all. The solution of course would be to use multiple categories, but I personally don't use the categories functionality at all (just one for everything).shypike wrote:May I point out that SABnzbd (since 0.6.3) has the option to work without job folders?
The top of the Category page says:
Ending the path with an asterisk * will prevent creation of job folders.