mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1109 (Unhandled Error - Saving a file to an SD card)
This commit is contained in:
parent
1aaafb6919
commit
f55ff7d782
@ -326,7 +326,10 @@ class BooksModel(QAbstractTableModel):
|
|||||||
ans = []
|
ans = []
|
||||||
for row in (row.row() for row in rows):
|
for row in (row.row() for row in rows):
|
||||||
format = None
|
format = None
|
||||||
db_formats = set(self.db.formats(row).lower().split(','))
|
fmts = self.db.formats(row)
|
||||||
|
if not fmts:
|
||||||
|
return []
|
||||||
|
db_formats = set(fmts.lower().split(','))
|
||||||
available_formats = set([f.lower() for f in formats])
|
available_formats = set([f.lower() for f in formats])
|
||||||
u = available_formats.intersection(db_formats)
|
u = available_formats.intersection(db_formats)
|
||||||
for f in formats:
|
for f in formats:
|
||||||
|
@ -577,7 +577,7 @@ class LibraryDatabase2(LibraryDatabase):
|
|||||||
return set([f[0] for f in formats])
|
return set([f[0] for f in formats])
|
||||||
|
|
||||||
def formats(self, index, index_is_id=False):
|
def formats(self, index, index_is_id=False):
|
||||||
''' Return available formats as a comma separated list or None if htere are no available formats '''
|
''' Return available formats as a comma separated list or None if there are no available formats '''
|
||||||
id = index if index_is_id else self.id(index)
|
id = index if index_is_id else self.id(index)
|
||||||
path = os.path.join(self.library_path, self.path(id, index_is_id=True))
|
path = os.path.join(self.library_path, self.path(id, index_is_id=True))
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user