mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-27 11:45:44 +00:00
Prevent wrongly encoded torrents from causing an xmlrpc exception thus causing
a blank torrent list
This commit is contained in:
parent
c4e4647f4b
commit
c429d56170
@ -445,7 +445,7 @@ class Torrent:
|
||||
for index, file in enumerate(files):
|
||||
ret.append({
|
||||
'index': index,
|
||||
'path': file.path,
|
||||
'path': file.path.decode("utf8", "ignore"),
|
||||
'size': file.size,
|
||||
'offset': file.offset
|
||||
})
|
||||
@ -586,7 +586,11 @@ class Torrent:
|
||||
|
||||
def ti_name():
|
||||
if self.handle.has_metadata():
|
||||
return self.torrent_info.name()
|
||||
try:
|
||||
return self.torrent_info.name().decode("utf8", "ignore")
|
||||
except UnicodeDecodeError:
|
||||
return self.torrent_info.name()
|
||||
|
||||
return self.torrent_id
|
||||
def ti_priv():
|
||||
if self.handle.has_metadata():
|
||||
|
Loading…
x
Reference in New Issue
Block a user