Page 1 of 1

run user script even if duplicate detected

Posted: October 19th, 2012, 3:26 pm
by mmesh
Hi!

Would it be possible to add an option to Queue -> Detect Duplicate Downloads that would allow sabnzbd to run a user script for already downloaded files if duplicate download was detected?

I have set sabnzbdplus on internet server to which couple of remote users (sickbeard) are connecting and most of the items that are triggered are duplicate. But they both are using different categories for the same items and each of them need to run their own post process script.

Is it possible?
I looked a bit into the code and as far as I can see it would be a simple call to external_processing method. But I don't know how to prepare arguments for this method at this part of code in sabnzbd/nzbstuff.py:

Code: Select all

        if duplicate and cfg.no_dupes() == 1:
            logging.warning(Ta('Ignoring duplicate NZB "%s" - category [%s], script [%s]'), (filename, self.cat, self.script))
            self.purge_data(keep_basic=False)
            raise TypeError
Or does one need to propagate more down to sabnzbd/postproc.py skipping somehow over redownload and other postprocess steps before running user defined post script.

Some pointers or info, please?

Re: run user script even if duplicate detected

Posted: October 19th, 2012, 4:34 pm
by shypike
Not exactly a very common use case, is it?
An alternative is to make a pre-queue script and use it to do
your own duplicate checking and whatever is needed in such a case.
See the Wiki for more info.

Re: run user script even if duplicate detected

Posted: October 20th, 2012, 2:15 am
by mmesh
OK. I'll look into pre-queue scripts and try to solve it there...

Thanks.