Store: Shorten filename to prevent errors where the download name is to long.

This commit is contained in:
John Schember 2011-09-20 20:13:18 -04:00
parent 7fc7d7487c
commit 64729ef1ab
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class EbookDownload(object):
return dfilename
if not filename:
filename = get_download_filename(url, cookie_file)
filename = get_download_filename(url, cookie_file)[:60]
br = browser()
if cookie_file:

View File

@ -350,7 +350,7 @@ class SearchDialog(QDialog, Ui_Dialog):
d = ChooseFormatDialog(self, _('Choose format to download to your library.'), result.downloads.keys())
if d.exec_() == d.Accepted:
ext = d.format()
fname = result.title + '.' + ext.lower()
fname = result.title[:60] + '.' + ext.lower()
fname = ascii_filename(fname)
self.gui.download_ebook(result.downloads[ext], filename=fname)