fixed for updated version of Gamez

This commit is contained in:
Clinton Hall 2013-03-06 21:03:48 -08:00
commit eaf4385cde

View file

@ -66,13 +66,15 @@ def process(dirName, nzbName=None, status=0):
else:
protocol = "http://"
baseURL = protocol + host + ":" + port + web_root + "/api?api_key=" + apikey + "&mode="
fields = nzbName.split("-")
gamezID = fields[0].replace("[","").replace("]","").replace(" ","")
downloadStatus = 'Wanted'
if(status == '0'):
if status == 0:
downloadStatus = 'Downloaded'
URL = protocol + host + ":" + port + web_root + "updatestatus?game_id=" + gamezID + "&status=" + downloadStatus
URL = baseURL + "UPDATEREQUESTEDSTATUS&db_id=" + gamezID + "&status=" + downloadStatus
Logger.debug("Opening URL: %s", url)
@ -84,7 +86,7 @@ def process(dirName, nzbName=None, status=0):
result = json.load(urlObj)
Logger.info("Gamez returned %s", result)
if result == "OK":
if result['success']:
Logger.info("Status for %s has been set to %s in Gamez", gamezID, downloadStatus)
else:
Logger.error("Status for %s has NOT been updated in Gamez", gamezID)