mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
8367f875a5
commit
219feadc1e
@ -124,12 +124,15 @@ class PDNOVEL_KOBO(PDNOVEL):
|
|||||||
|
|
||||||
BCD = [0x222]
|
BCD = [0x222]
|
||||||
|
|
||||||
EBOOK_DIR_MAIN = 'eBooks/Kobo'
|
EBOOK_DIR_MAIN = 'eBooks'
|
||||||
|
|
||||||
def upload_cover(self, path, filename, metadata, filepath):
|
def upload_cover(self, path, filename, metadata, filepath):
|
||||||
coverdata = getattr(metadata, 'thumbnail', None)
|
coverdata = getattr(metadata, 'thumbnail', None)
|
||||||
if coverdata and coverdata[2]:
|
if coverdata and coverdata[2]:
|
||||||
with open(os.path.join(path, '.thumbnail', filename+'.jpg'), 'wb') as coverfile:
|
dirpath = os.path.join(path, '.thumbnail')
|
||||||
|
if not os.path.exists(dirpath):
|
||||||
|
os.makedirs(dirpath)
|
||||||
|
with open(os.path.join(dirpath, filename+'.jpg'), 'wb') as coverfile:
|
||||||
coverfile.write(coverdata[2])
|
coverfile.write(coverdata[2])
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user