mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Kindle driver: Detect presence of sdr dirs explicitly
This commit is contained in:
parent
34f263bda1
commit
d2c188cbaa
@ -350,8 +350,14 @@ class KINDLE2(KINDLE):
|
|||||||
# Detect if the product family needs .apnx files uploaded to sidecar folder
|
# Detect if the product family needs .apnx files uploaded to sidecar folder
|
||||||
def post_open_callback(self):
|
def post_open_callback(self):
|
||||||
product_id = self.device_being_opened[1]
|
product_id = self.device_being_opened[1]
|
||||||
# 4 for for Kindle 4 and 6 for Kindle Fire
|
self.sidecar_apnx = False
|
||||||
self.sidecar_apnx = product_id in {0x4, 0x6}
|
if product_id > 0x3:
|
||||||
|
# Check if we need to put the apnx into a sidecar dir
|
||||||
|
for _, dirnames, _ in os.walk(self._main_prefix):
|
||||||
|
for x in dirnames:
|
||||||
|
if x.endswith('.sdr'):
|
||||||
|
self.sidecar_apnx = True
|
||||||
|
return
|
||||||
|
|
||||||
def upload_cover(self, path, filename, metadata, filepath):
|
def upload_cover(self, path, filename, metadata, filepath):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user