Skip to content

Commit

Permalink
Propgation delay could show even if it was not configured
Browse files Browse the repository at this point in the history
  • Loading branch information
Safihre committed May 12, 2019
1 parent 129d3ea commit f628dda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion sabnzbd/nzbqueue.py
Expand Up @@ -722,11 +722,13 @@ def get_article(self, server, servers):
""" Get next article for jobs in the queue
Not locked for performance, since it only reads the queue
"""
# Pre-calculate propagation delay
propagtion_delay = float(cfg.propagation_delay() * 60)
for nzo in self.__nzo_list:
# Not when queue paused and not a forced item
if nzo.status not in (Status.PAUSED, Status.GRABBING) or nzo.priority == TOP_PRIORITY:
# Check if past propagation delay, or forced
if not cfg.propagation_delay() or nzo.priority == TOP_PRIORITY or (nzo.avg_stamp + float(cfg.propagation_delay() * 60)) < time.time():
if not propagtion_delay or nzo.priority == TOP_PRIORITY or (nzo.avg_stamp + propagtion_delay) < time.time():
if not nzo.server_in_try_list(server):
article = nzo.get_article(server, servers)
if article:
Expand Down
5 changes: 3 additions & 2 deletions sabnzbd/nzbstuff.py
Expand Up @@ -1331,8 +1331,9 @@ def final_name_labeled(self):
dif = int(self.url_wait - time.time() + 0.5)
if dif > 0:
prefix += T('WAIT %s sec') % dif + ' / ' # : Queue indicator for waiting URL fetch
if (self.avg_stamp + float(cfg.propagation_delay() * 60)) > time.time() and self.priority != TOP_PRIORITY:
wait_time = int((self.avg_stamp + float(cfg.propagation_delay() * 60) - time.time()) / 60 + 0.5)
propagtion_delay = float(cfg.propagation_delay() * 60)
if propagtion_delay and (self.avg_stamp + propagtion_delay) > time.time() and self.priority != TOP_PRIORITY:
wait_time = int((self.avg_stamp + propagtion_delay - time.time()) / 60 + 0.5)
prefix += T('PROPAGATING %s min') % wait_time + ' / ' # : Queue indicator while waiting for propagation of post
return '%s%s' % (prefix, self.final_name)

Expand Down

0 comments on commit f628dda

Please sign in to comment.