mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-12 03:18:47 +00:00
handle non-supported images/files in the icons folder
This commit is contained in:
parent
b13adbafbf
commit
53930e0898
1 changed files with 7 additions and 1 deletions
|
@ -142,7 +142,10 @@ class TrackerIcons(Component):
|
||||||
for icon in os.listdir(self.dir):
|
for icon in os.listdir(self.dir):
|
||||||
if icon != noIcon:
|
if icon != noIcon:
|
||||||
host = icon_name_to_host(icon)
|
host = icon_name_to_host(icon)
|
||||||
self.icons[host] = TrackerIcon(os.path.join(self.dir, icon))
|
try:
|
||||||
|
self.icons[host] = TrackerIcon(os.path.join(self.dir, icon))
|
||||||
|
except KeyError:
|
||||||
|
log.warning("invalid icon %s", icon)
|
||||||
if noIcon:
|
if noIcon:
|
||||||
self.icons[None] = TrackerIcon(noIcon)
|
self.icons[None] = TrackerIcon(noIcon)
|
||||||
else:
|
else:
|
||||||
|
@ -479,6 +482,9 @@ def icon_name_to_host(icon):
|
||||||
"""
|
"""
|
||||||
return icon.rpartition('.')[0]
|
return icon.rpartition('.')[0]
|
||||||
|
|
||||||
|
MIME_MAP = {
|
||||||
|
}
|
||||||
|
|
||||||
def mimetype_to_ext(mimetype):
|
def mimetype_to_ext(mimetype):
|
||||||
"""
|
"""
|
||||||
Given a mimetype, returns the appropriate filename extension
|
Given a mimetype, returns the appropriate filename extension
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue