summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/UnSkipOnFail.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/UnSkipOnFail.py')
-rw-r--r--module/plugins/hooks/UnSkipOnFail.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py
index 1becb937a..b9ae93fee 100644
--- a/module/plugins/hooks/UnSkipOnFail.py
+++ b/module/plugins/hooks/UnSkipOnFail.py
@@ -1,24 +1,26 @@
# -*- coding: utf-8 -*-
from module.PyFile import PyFile
-from module.plugins.Hook import Hook
+from module.plugins.internal.Hook import Hook
class UnSkipOnFail(Hook):
__name__ = "UnSkipOnFail"
__type__ = "hook"
- __version__ = "0.05"
+ __version__ = "0.08"
__config__ = [("activated", "bool", "Activated", True)]
- __description__ = """Queue skipped duplicates when download fails"""
+ __description__ = """Restart skipped duplicates when download fails"""
__license__ = "GPLv3"
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
- #@TODO: Remove in 0.4.10
- def initPeriodical(self):
- pass
+ interval = 0 #@TODO: Remove in 0.4.10
+
+
+ def setup(self):
+ self.info = {} #@TODO: Remove in 0.4.10
def downloadFailed(self, pyfile):
@@ -30,9 +32,9 @@ class UnSkipOnFail(Hook):
msg = _("Looking for skipped duplicates of: %s (pid:%s)")
self.logInfo(msg % (pyfile.name, pyfile.package().id))
- dup = self.findDuplicate(pyfile)
- if dup:
- self.logInfo(_("Queue found duplicate: %s (pid:%s)") % (dup.name, dup.packageID))
+ link = self.findDuplicate(pyfile)
+ if link:
+ self.logInfo(_("Queue found duplicate: %s (pid:%s)") % (link.name, link.packageID))
#: Change status of "link" to "new_status".
# "link" has to be a valid FileData object,
@@ -41,9 +43,9 @@ class UnSkipOnFail(Hook):
# It creates a temporary PyFile object using
# "link" data, changes its status, and tells
# the core.files-manager to save its data.
- pylink = _pyfile(link)
+ pylink = self._pyfile(link)
- pylink.setCustomStatus("UnSkipOnFail", "queued")
+ pylink.setCustomStatus(_("unskipped"), "queued")
self.core.files.save()
pylink.release()