Ticket #1614: autoadd.py.patch

File autoadd.py.patch, 1.1 KB (added by John Garland, 14 years ago)

autoadd.py patch

  • deluge/core/autoadd.py

    diff --git a/deluge/core/autoadd.py b/deluge/core/autoadd.py
    index 6d3d7a8..8d1219c 100644
    a b def update(self):  
    7474            return
    7575
    7676        for filename in os.listdir(self.config["autoadd_location"]):
    77             if filename.split(".")[-1] == "torrent":
    78                 try:
    79                     filepath = os.path.join(self.config["autoadd_location"], filename)
    80                 except UnicodeDecodeError, e:
    81                     log.error("Unable to auto add torrent due to inproper filename encoding: %s", e)
    82                     continue
     77            try:
     78                filepath = os.path.join(self.config["autoadd_location"], filename)
     79            except UnicodeDecodeError, e:
     80                log.error("Unable to auto add torrent due to improper filename encoding: %s", e)
     81                continue
     82            if os.path.isfile(filepath) and filename.endswith(".torrent"):
    8383                try:
    8484                    filedump = self.load_torrent(filepath)
    8585                except (RuntimeError, Exception), e: