clinton-hall / nzbToMedia

Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
GNU General Public License v3.0
672 stars 176 forks source link

category centric processing to enable multiple instances of sickbeard/others #230

Closed mabelrxu closed 10 years ago

mabelrxu commented 10 years ago

currently nzbToMedia is designed only for 1 instance each of sickbeard, couchpotato, etc.

I want to run 2 sickbeard installations concurrently, but am unable to successfully have them post process by using nzbToMedia, despite following the instructions at https://github.com/clinton-hall/nzbToMedia/issues/128 ... in addition, the instructions for the modification required hard coding in the values for server, port, username, and password, and did not match the current version in line numbers, etc.

what if the settings file was setup instead with categories being used as section headers, then an application underneath specifying which database it should go to? for example:

[tv] app = /usr/local/sickbeard username = password = server = port = other settings

[anime] app = /usr/local/sickbeard-anime username = password = server = port = other settings

this way, there can be as many instances of any of the applications as you want, for example for people who want to run multiple installations to keep downloads for different family members separated from each other, with each person getting their own sickbeard or couchpotato so that they can manage their own shows / movies without messing with other people's downloads, yet all the usenet downloading is still concentrated on that 1 machine for maximizing the usage of the # of connections.

clinton-hall commented 10 years ago

I like the concept, however the issue is that the settings for SickBeard, CouchPotato and Headphones etc are slightly different, so I can't (easily) make this category centric......

Perhaps something like this:

[SickBeard]
sbCategory = tv
host = localhost
port = 8081
username =
password =
web_root = 
ssl = 0
delay = 0
watch_dir =
failed_fork = 0
delete_failed = 0

is default, but if you specify 2 (or more categories for sickbeard, then each has it's own header...)

[SickBeard]
sbCategory = tv,anime

[tv]
host = localhost
port = 8081
username =
password =
web_root = 
ssl = 0
delay = 0
watch_dir =
failed_fork = 0
delete_failed = 0

[anime]
host = localhost
port = 8081
username =
password =
web_root = 
ssl = 0
delay = 0
watch_dir =
failed_fork = 0
delete_failed = 0

that way, if the category is in sbCategory, I then pass the category in to the autoProcessTV script and actually tell it to load the config from that particular category header...

mabelrxu commented 10 years ago

also, following the instructions from issue https://github.com/clinton-hall/nzbToMedia/issues/128 results in the post processing never finishing ... it just spins and spins forever and ever

clinton-hall commented 10 years ago

this way allows me to do the same for CouchPotato and Headphones etc... without disrupting anyone's current config (i.e backwards compatible)

mabelrxu commented 10 years ago

I looked up the configparser on python manual online, there's nothing that says you can't have a different number of config variables for each section?

mabelrxu commented 10 years ago

true, backwards compatibility would be shot if change to using category as section headers

clinton-hall commented 10 years ago

no, there is no limit... but i don't want to kill existing configs, and currently, where the config is read, we don't have access to the category...

clinton-hall commented 10 years ago

lol... timing... I'll try and get a new branch set up for testing soon.

mabelrxu commented 10 years ago

excellent, ty. my current nzbToMedia install is a git clone of master, so I can easily git clone whatever testing branch for helping you test :)

clinton-hall commented 10 years ago

update to dev-cat branch and set up config as

[SickBeard]
sbCategory = tv,anime

[tv]
host = localhost
port = 8081
username =
password =
web_root = 
ssl = 0
delay = 0
watch_dir =
failed_fork = 0
delete_failed = 0

[anime]
host = localhost
port = 8081
username =
password =
web_root = 
ssl = 0
delay = 0
watch_dir =
failed_fork = 0
delete_failed = 0

I haven't yet tested and am bound to have made mistakes....

mabelrxu commented 10 years ago
      Traceback (most recent call last):

File "/home/adams/.sabnzbd/scripts/nzbToMedia/nzbToMedia.py", line 252, in import autoProcess.autoProcessMusic as autoProcessMusic File "/home/adams/.sabnzbd/scripts/nzbToMedia/autoProcess/autoProcessMusic.py", line 33 host = config.get(section., "host")

clinton-hall commented 10 years ago

damn... that was a stupid one at my end... missed that "." that crept in when I copied these across... Just too small to notice each time I read through those changes.

Please git pull and try again.

mabelrxu commented 10 years ago

success :)

mabelrxu commented 10 years ago

btw I only tested with sickbeard, not with any of the others ... you want me test those too? while i'm at it?

clinton-hall commented 10 years ago

If you are able that would be great...