mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 06:03:44 +02:00
PD Novel driver: Add support for uploading cover thumbnails to device
This commit is contained in:
parent
70a3c06227
commit
9bb0e21d04
1 changed files with 9 additions and 0 deletions
|
|
@ -6,6 +6,8 @@
|
|||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
|
||||
from calibre.devices.usbms.driver import USBMS
|
||||
|
||||
class PALMPRE(USBMS):
|
||||
|
|
@ -83,7 +85,14 @@ class PDNOVEL(USBMS):
|
|||
|
||||
VENDOR_NAME = 'ANDROID'
|
||||
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = '__UMS_COMPOSITE'
|
||||
THUMBNAIL_HEIGHT = 144
|
||||
|
||||
EBOOK_DIR_MAIN = 'eBooks'
|
||||
SUPPORTS_SUB_DIRS = False
|
||||
|
||||
def upload_cover(self, path, filename, metadata):
|
||||
coverdata = getattr(metadata, 'thumbnail', None)
|
||||
if coverdata and coverdata[2]:
|
||||
with open('%s.jpg' % os.path.join(path, filename), 'wb') as coverfile:
|
||||
coverfile.write(coverdata[2])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue