Page 1 of 1

Folder creation behavior during unpacking with Sorting enabled

Posted: May 6th, 2018, 3:52 pm
by hugepants
I have recently updated from SABnzbd 2.0.2 to 2.3.3 on Debian.

I have a movies category which is enabled for sorting with the following sort string:

Code: Select all

%dn/%title (%y).%ext
This results in Original.Job.Name/Movie (year).ext, which is stored in /movies

Jobs are being extracted to /movies/Original.Job.Name/_UNPACK_Original.Job.Name

In my Kodi player, when I view a directory listing of /movies, it hides directories which start with _UNPACK_ because I have set it to ignore these.

The issue is, when sorting is turned on, jobs are unpacked to /movies/Original.Job.Name/_UNPACK_Movie.Job.Name so the directory Original.Job.Name shows in the Kodi directory listing, even when it hasn't finished downloading. When I go into this directory, it is empty because _UNPACK_Movie.Job.Name is ignored by Kodi. However, I don't want to see Original.Job.Name listed until it's actually downloaded and ready with a media file inside it.

If I turn sorting off, this is ideal, as jobs are extracted to /movies/_UNPACK_Original.Job.Name and it is absent from Kodi's directory listing as the _UNPACK_ is present. This is how SABnzbd 2.0.2 behaved even with sorting turned on.

In 2.3.3 with sorting enabled, is there a way to unpack to /movies/_UNPACK_Original.Job.Name instead of /movies/Original.Job.Name/_UNPACK_Original.Job.Name ?

Thanks!

Re: Folder creation behavior during unpacking with Sorting enabled

Posted: May 7th, 2018, 2:11 am
by safihre
No sorry, this is due to Direct Unpack.
Since we start unpacking during the downloading, we need to know already the final directory name before we start unpacking.
Maybe on your system it wasn't enabled, we only enabled it automatically when the system-disk-performance test was fast enough.

Re: Folder creation behavior during unpacking with Sorting enabled

Posted: May 7th, 2018, 8:03 am
by hugepants
Yes, Direct Unpack wasn't enabled before and it is now.

Ok, I have solved the issue by changing the sort string to:

Code: Select all

-UNPACK-%dn/%title (%y).%ext
(it does not allow an underscore as the first character)

Then, I added -UNPACK- to the ignore list in Kodi.

Finally, after download is complete, in my post processing script, I rename the directory by removing the -UNPACK-, check if it already exists, and append a digit if necessary. This gets it close to how it was before.

Thanks for your quick reply, I like the new version, great job :)

Re: Folder creation behavior during unpacking with Sorting enabled

Posted: May 7th, 2018, 9:07 am
by safihre
You can also use the Config > Specials > nomedia_marker setting.
Here you could set a specific empty marker file that is created at the start of unpacking and removed at the end of all processing. For example ".nomedia", which is often used to ignore folders.
If Kodi supports something like that (probably does?) it might be even easier!
Just thought of it.

Re: Folder creation behavior during unpacking with Sorting enabled

Posted: May 7th, 2018, 10:54 am
by hugepants
Thanks for the tip! Kodi does support .nomedia files in its library view to ignore folders from being scanned.

However, it doesn't affect the plain files/directory view, which is what I use. This is a raw listing of all files/directories, of which some can only be hidden by including a string to ignore in the file/directory name itself (Link).

Re: Folder creation behavior during unpacking with Sorting enabled

Posted: May 7th, 2018, 3:58 pm
by safihre
Aah oke, yes in that case your current solution fixes it somewhat!