mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
GwR fix for no serial number on windows
This commit is contained in:
parent
096e53c484
commit
20ec8cc3ed
@ -259,7 +259,9 @@ def generate_catalog(parent, dbspec, ids, device):
|
||||
storage.append(os.path.join(device._card_a_prefix, device.EBOOK_DIR_CARD_A))
|
||||
if device._card_b_prefix:
|
||||
storage.append(os.path.join(device._card_b_prefix, device.EBOOK_DIR_CARD_B))
|
||||
connected_device = {'storage': storage,'serial':device.detected_device.serial,
|
||||
connected_device = {'storage': storage,
|
||||
'serial': device.detected_device.serial if \
|
||||
hasattr(device.detected_device,'serial') else None,
|
||||
'name': device.gui_name}
|
||||
|
||||
# These args are passed inline to gui2.convert.gui_conversion:gui_catalog
|
||||
|
@ -3403,7 +3403,10 @@ class EPUB_MOBI(CatalogPlugin):
|
||||
if op is None:
|
||||
op = 'default'
|
||||
if opts.connected_device['name'] and 'kindle' in opts.connected_device['name'].lower():
|
||||
op = "kindle_dx" if opts.connected_device['serial'][:4] in ['B004','B005'] else 'kindle'
|
||||
if opts.connected_device['serial'] and opts.connected_device['serial'][:4] in ['B004','B005']:
|
||||
op = "kindle_dx"
|
||||
else:
|
||||
op = "kindle"
|
||||
opts.descriptionClip = 380 if op.endswith('dx') or 'kindle' not in op else 100
|
||||
opts.authorClip = 100 if op.endswith('dx') or 'kindle' not in op else 60
|
||||
self.opts.output_profile = op
|
||||
@ -3436,9 +3439,14 @@ class EPUB_MOBI(CatalogPlugin):
|
||||
log(" converting empty exclude_genre to '\[^.\]'")
|
||||
|
||||
if opts.connected_device['name']:
|
||||
log(" connected_device: '%s' #%s%s " % (opts.connected_device['name'],
|
||||
if opts.connected_device['serial']:
|
||||
log(" connected_device: '%s' #%s%s " % \
|
||||
(opts.connected_device['name'],
|
||||
opts.connected_device['serial'][0:4],
|
||||
'x' * (len(opts.connected_device['serial']) - 4)))
|
||||
else:
|
||||
log(" connected_device: '%s'" % opts.connected_device['name'])
|
||||
|
||||
for storage in opts.connected_device['storage']:
|
||||
if storage:
|
||||
log(" mount point: %s" % storage)
|
||||
|
Loading…
x
Reference in New Issue
Block a user