mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
py3: Fix an error when downloading books via Get Books
Fixes #1862719 [TypeError: 'dict_keys' object does not support indexing](https://bugs.launchpad.net/calibre/+bug/1862719)
This commit is contained in:
parent
449672bab1
commit
ad22288784
@ -41,6 +41,7 @@ class ChooseFormatDialog(QDialog):
|
||||
bb.accepted.connect(self.accept), bb.rejected.connect(self.reject)
|
||||
h.addStretch(10), h.addWidget(self.buttonBox)
|
||||
|
||||
formats = list(formats)
|
||||
for format in formats:
|
||||
self.formats.addItem(QListWidgetItem(file_icon_provider().icon_from_ext(format.lower()),
|
||||
format.upper()))
|
||||
|
@ -392,7 +392,7 @@ class SearchDialog(QDialog, Ui_Dialog):
|
||||
self.open_store(result)
|
||||
|
||||
def download_book(self, result):
|
||||
d = ChooseFormatDialog(self, _('Choose format to download to your library.'), result.downloads.keys())
|
||||
d = ChooseFormatDialog(self, _('Choose format to download to your library.'), list(result.downloads.keys()))
|
||||
if d.exec_() == d.Accepted:
|
||||
ext = d.format()
|
||||
fname = result.title[:60] + '.' + ext.lower()
|
||||
|
Loading…
x
Reference in New Issue
Block a user