mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: Shorten filename to prevent errors where the download name is to long.
This commit is contained in:
parent
7fc7d7487c
commit
64729ef1ab
@ -44,7 +44,7 @@ class EbookDownload(object):
|
|||||||
return dfilename
|
return dfilename
|
||||||
|
|
||||||
if not filename:
|
if not filename:
|
||||||
filename = get_download_filename(url, cookie_file)
|
filename = get_download_filename(url, cookie_file)[:60]
|
||||||
|
|
||||||
br = browser()
|
br = browser()
|
||||||
if cookie_file:
|
if cookie_file:
|
||||||
|
@ -350,7 +350,7 @@ class SearchDialog(QDialog, Ui_Dialog):
|
|||||||
d = ChooseFormatDialog(self, _('Choose format to download to your library.'), result.downloads.keys())
|
d = ChooseFormatDialog(self, _('Choose format to download to your library.'), result.downloads.keys())
|
||||||
if d.exec_() == d.Accepted:
|
if d.exec_() == d.Accepted:
|
||||||
ext = d.format()
|
ext = d.format()
|
||||||
fname = result.title + '.' + ext.lower()
|
fname = result.title[:60] + '.' + ext.lower()
|
||||||
fname = ascii_filename(fname)
|
fname = ascii_filename(fname)
|
||||||
self.gui.download_ebook(result.downloads[ext], filename=fname)
|
self.gui.download_ebook(result.downloads[ext], filename=fname)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user