diff options
Diffstat (limited to 'module')
| -rw-r--r-- | module/ThreadManager.py | 6 | ||||
| -rw-r--r-- | module/plugins/hooks/UnRar.py | 23 | ||||
| -rw-r--r-- | module/web/templates/default/package_ui.js | 11 | 
3 files changed, 25 insertions, 15 deletions
| diff --git a/module/ThreadManager.py b/module/ThreadManager.py index a482ff311..9aa3368c0 100644 --- a/module/ThreadManager.py +++ b/module/ThreadManager.py @@ -84,8 +84,10 @@ class ThreadManager:      #----------------------------------------------------------------------      def work(self):          """run all task which have to be done (this is for repetivive call by core)""" - -        self.tryReconnect() +        try: +            self.tryReconnect() +        except Exception, e: +            self.log.error(_("Reconnect Failed: %s") % str(e) )          self.checkThreadCount()          self.assignJob() diff --git a/module/plugins/hooks/UnRar.py b/module/plugins/hooks/UnRar.py index 9ee9b2d46..8875ce95f 100644 --- a/module/plugins/hooks/UnRar.py +++ b/module/plugins/hooks/UnRar.py @@ -54,12 +54,16 @@ class UnRar(Hook):                  f.writelines(self.comments)          self.re_splitfile = re.compile("(.*)\.part(\d+)\.rar$") -    def addPassword(self, pw): -        if not pw in self.passwords: +    def addPassword(self, pws): +        if not type(pws) == list: pws = [pws] +        for pw in pws: +            pw = pw.strip() +            if not pw or pw == "None" or pw in self.passwords: continue              self.passwords.insert(0, pw) -            with open(self.getConfig("passwordfile"), "w") as f: -                f.writelines(self.comments) -                f.writelines(self.passwords) + +        with open(self.getConfig("passwordfile"), "w") as f: +            f.writelines(self.comments) +            f.writelines(self.passwords)      def removeFiles(self, pack, fname):          if not self.getConfig("deletearchive"): @@ -83,8 +87,8 @@ class UnRar(Hook):                      remove(join(folder, data["name"]))      def packageFinished(self, pack): -        if pack.password: -            self.addPassword(pack.password) +        if pack.password.strip() and pack.password.strip() != "None": +            self.addPassword(pack.password.splitlines())          files = []          for fid, data in pack.getChildren().iteritems():              m = self.re_splitfile.search(data["name"]) @@ -94,6 +98,7 @@ class UnRar(Hook):                  files.append((fid,data["name"]))          for fid, fname in files: +            self.core.log.info(_("starting Unrar of %s") % fname)              pyfile = self.core.files.getFile(fid)              pyfile.setStatus("processing")              def s(p): @@ -117,7 +122,7 @@ class UnRar(Hook):                      continue                  try:                      if e.getExitCode() == 1 and len(u.listContent(u.getPassword())) == 1: -                        self.core.log.debug("Unrar of %s ok" % fname) +                        self.core.log.info("Unrar of %s ok" % fname)                          self.removeFiles(pack, fname)                  except:                      self.core.log.info("Unrar of %s failed" % fname) @@ -127,7 +132,7 @@ class UnRar(Hook):                  continue              else:                  if success: -                    self.core.log.debug("Unrar of %s ok" % fname) +                    self.core.log.info("Unrar of %s ok" % fname)                      self.removeFiles(pack, fname)                  else:                      self.core.log.info("Unrar of %s failed (wrong password)" % fname) diff --git a/module/web/templates/default/package_ui.js b/module/web/templates/default/package_ui.js index 751780180..6ef254e6a 100644 --- a/module/web/templates/default/package_ui.js +++ b/module/web/templates/default/package_ui.js @@ -70,7 +70,7 @@ var PackageUI = new Class({              revert: true,              opacity: 0.4,              handle: ".package_drag", -            onStart: this.startSort, +            //onStart: this.startSort,              onComplete: this.saveSort.bind(this)          });      }, @@ -266,7 +266,8 @@ var Package = new Class({              onSuccess: function(){                  this.ele.nix();                  indicateFinish(); -            }.bind(this) +            }.bind(this), +            onFailure: indicateFail          }).send();          event.stop();      }, @@ -286,7 +287,8 @@ var Package = new Class({                  this.linksLoaded = false;                  indicateSuccess(); -            }.bind(this) +            }.bind(this), +            onFailure: indicateFail          }).send();          event.stop();      }, @@ -299,7 +301,8 @@ var Package = new Class({              onSuccess: function(){                  this.ele.nix();                  indicateFinish(); -            }.bind(this) +            }.bind(this), +            onFailure: indicateFail          }).send();          event.stop();      }, | 
