Folder creation behavior during unpacking with Sorting enabled

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
hugepants
Newbie
Newbie
Posts: 14
Joined: May 26th, 2013, 5:16 am

Folder creation behavior during unpacking with Sorting enabled

Post 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!
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Folder creation behavior during unpacking with Sorting enabled

Post 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.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
hugepants
Newbie
Newbie
Posts: 14
Joined: May 26th, 2013, 5:16 am

Re: Folder creation behavior during unpacking with Sorting enabled

Post 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 :)
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Folder creation behavior during unpacking with Sorting enabled

Post 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.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
hugepants
Newbie
Newbie
Posts: 14
Joined: May 26th, 2013, 5:16 am

Re: Folder creation behavior during unpacking with Sorting enabled

Post 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).
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Folder creation behavior during unpacking with Sorting enabled

Post by safihre »

Aah oke, yes in that case your current solution fixes it somewhat!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply