Detect .azw3 files on Kindle devices

This commit is contained in:
Kovid Goyal 2012-04-17 22:03:05 +05:30
parent 8d3c9d93b3
commit 340a87fab6
2 changed files with 8 additions and 1 deletions

View File

@ -325,6 +325,10 @@ class KINDLE2(KINDLE):
OPT_APNX_ACCURATE = 1
OPT_APNX_CUST_COL = 2
def formats_to_scan_for(self):
ans = USBMS.formats_to_scan_for(self) | {'azw3'}
return ans
def books(self, oncard=None, end_session=True):
bl = USBMS.books(self, oncard=oncard, end_session=end_session)
# Read collections information

View File

@ -128,6 +128,9 @@ class USBMS(CLI, Device):
elif location_code == 'B':
self._update_driveinfo_file(self._card_b_prefix, location_code, name)
def formats_to_scan_for(self):
return set(self.settings().format_map) | set(self.FORMATS)
def books(self, oncard=None, end_session=True):
from calibre.ebooks.metadata.meta import path_to_ext
@ -166,7 +169,7 @@ class USBMS(CLI, Device):
for idx,b in enumerate(bl):
bl_cache[b.lpath] = idx
all_formats = set(self.settings().format_map) | set(self.FORMATS)
all_formats = self.formats_to_scan_for()
def update_booklist(filename, path, prefix):
changed = False