Improve autoadd filename matching (fixes #1614)

This commit is contained in:
John Garland 2011-03-23 23:38:41 +11:00
parent 884bfd777e
commit 00ad550a52
2 changed files with 7 additions and 6 deletions

View file

@ -6,6 +6,7 @@
* Fix a bug that can occur when upgrading 1.1 config files
* #1517: Fix isohunt urls not loading
* Handle redirection when adding a torrent by url
* #1614: Fix autoadd matching a directory called "torrent"
==== GtkUI ====
* #1514: Added Indicator Applet

View file

@ -74,12 +74,12 @@ class AutoAdd(component.Component):
return
for filename in os.listdir(self.config["autoadd_location"]):
if filename.split(".")[-1] == "torrent":
try:
filepath = os.path.join(self.config["autoadd_location"], filename)
except UnicodeDecodeError, e:
log.error("Unable to auto add torrent due to inproper filename encoding: %s", e)
continue
try:
filepath = os.path.join(self.config["autoadd_location"], filename)
except UnicodeDecodeError, e:
log.error("Unable to auto add torrent due to improper filename encoding: %s", e)
continue
if os.path.isfile(filepath) and filename.endswith(".torrent"):
try:
filedump = self.load_torrent(filepath)
except (RuntimeError, Exception), e: