Optimize ti_name a touch

This commit is contained in:
Andrew Resch 2009-05-09 03:42:39 +00:00
commit 96c399f7f5

View file

@ -621,7 +621,7 @@ class Torrent:
def ti_name(): def ti_name():
if self.handle.has_metadata(): if self.handle.has_metadata():
name = os.path.split(self.torrent_info.file_at(0).path)[0] name = self.torrent_info.file_at(0).path.split("/")[0]
try: try:
return name.decode("utf8", "ignore") return name.decode("utf8", "ignore")
except UnicodeDecodeError: except UnicodeDecodeError: