mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
better nzbdrone status check. Fixes #433
This commit is contained in:
parent
c5103042ae
commit
47a1dcb957
1 changed files with 7 additions and 1 deletions
|
@ -232,9 +232,12 @@ class autoProcessTV:
|
||||||
return 0
|
return 0
|
||||||
elif section == "NzbDrone" and Started:
|
elif section == "NzbDrone" and Started:
|
||||||
n = 0
|
n = 0
|
||||||
|
exists = True
|
||||||
current_numMissing = start_numMissing
|
current_numMissing = start_numMissing
|
||||||
while n < 6: # set up wait_for minutes of no change in numMissing.
|
while n < 6: # set up wait_for minutes of no change in numMissing.
|
||||||
time.sleep(10 * wait_for)
|
time.sleep(10 * wait_for)
|
||||||
|
if not os.path.exists(dirName):
|
||||||
|
break
|
||||||
new_numMissing = self.numMissing(url1, params, headers)
|
new_numMissing = self.numMissing(url1, params, headers)
|
||||||
if new_numMissing == current_numMissing: # nothing processed since last call
|
if new_numMissing == current_numMissing: # nothing processed since last call
|
||||||
n += 1
|
n += 1
|
||||||
|
@ -242,7 +245,10 @@ class autoProcessTV:
|
||||||
n = 0
|
n = 0
|
||||||
current_numMissing = new_numMissing # reset counter and start loop again with this many missing.
|
current_numMissing = new_numMissing # reset counter and start loop again with this many missing.
|
||||||
|
|
||||||
if current_numMissing < start_numMissing:
|
if not os.path.exists(dirName):
|
||||||
|
logger.debug("The directory %s has been removed. Renaming was successful." % (dirName), section)
|
||||||
|
return 0
|
||||||
|
elif current_numMissing < start_numMissing:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"The number of missing episodes changes from %s to %s and then remained the same for %s minutes. Consider this successful" %
|
"The number of missing episodes changes from %s to %s and then remained the same for %s minutes. Consider this successful" %
|
||||||
(str(start_numMissing), str(current_numMissing), str(wait_for)), section)
|
(str(start_numMissing), str(current_numMissing), str(wait_for)), section)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue