Skip to content

Commit

Permalink
Merge pull request metabrainz#681 from mineo/picard-1056
Browse files Browse the repository at this point in the history
PICARD-1056: Don't crash when opening file info dialogs
  • Loading branch information
zas authored Apr 7, 2017
2 parents 30be095 + 056947e commit 38cb6ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions picard/ui/infodialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ def format_file_info(file):
ch = str(ch)
info.append((_('Channels:'), ch))
return '<br/>'.join(map(lambda i: '<b>%s</b><br/>%s' %
(picard.util.htmlescape(i[0]),
picard.util.htmlescape(i[1])), info))
(htmlescape(i[0]),
htmlescape(i[1])), info))

def _display_info_tab(self):
file = self.obj
Expand All @@ -299,7 +299,7 @@ def _display_info_tab(self):
if album.errors:
tabWidget.setTabText(tab_index, _("&Errors"))
text = '<br />'.join(map(lambda s: '<font color="darkred">%s</font>' %
'<br />'.join(unicode(picard.util.htmlescape(s))
'<br />'.join(unicode(htmlescape(s))
.replace('\t', ' ')
.replace(' ', '&nbsp;')
.splitlines()
Expand Down Expand Up @@ -349,9 +349,9 @@ def _display_info_tab(self):
tabWidget.setTabText(tab_index, _("&Info"))
info = []
info.append("<b>%s</b> %s" % (_('Album:'),
unicode(picard.util.htmlescape(cluster.metadata["album"]))))
unicode(htmlescape(cluster.metadata["album"]))))
info.append("<b>%s</b> %s" % (_('Artist:'),
unicode(picard.util.htmlescape(cluster.metadata["albumartist"]))))
unicode(htmlescape(cluster.metadata["albumartist"]))))
info.append("")
lines = []
for file in cluster.iterfiles(False):
Expand All @@ -361,5 +361,5 @@ def _display_info_tab(self):
m["title"] + " - " + artist + " (" +
m["~length"] + ")")
info.append("<b>%s</b><br />%s" % (_('Tracklist:'),
'<br />'.join([unicode(picard.util.htmlescape(s)).replace(' ', '&nbsp;') for s in lines])))
'<br />'.join([unicode(htmlescape(s)).replace(' ', '&nbsp;') for s in lines])))
self.ui.info.setText('<br/>'.join(info))

0 comments on commit 38cb6ee

Please sign in to comment.