From f0d263993026ba3271e121ff48f92b0162dff931 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 28 Sep 2023 09:48:01 +0530 Subject: [PATCH] NOOK driver: For the Glowlight 2023 write the calibre metadata files into the NOOK sub-folder as the firmware doesnt allow writing files into the root folder --- src/calibre/devices/mtp/defaults.py | 7 +++---- src/calibre/devices/nook/driver.py | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/calibre/devices/mtp/defaults.py b/src/calibre/devices/mtp/defaults.py index 52500693b3..34119ffd47 100644 --- a/src/calibre/devices/mtp/defaults.py +++ b/src/calibre/devices/mtp/defaults.py @@ -31,8 +31,9 @@ class DeviceDefaults: # B&N devices ({'vendor':0x2080}, { 'format_map': ['epub', 'pdf'], - 'send_to': ['NOOK/My Books', 'NOOK/My Files', 'NOOK', 'Calibre_Companion', 'Books', - 'eBooks/import', 'eBooks', 'sdcard/ebooks'], + # NOOK does not allow writing files into root + 'calibre_file_paths': {'metadata':'NOOK/metadata.calibre', 'driveinfo':'NOOK/driveinfo.calibre'}, + 'send_to': ['NOOK/My Books', 'NOOK/My Files', 'NOOK', 'Calibre_Companion', 'Books', 'eBooks/import', 'eBooks', 'sdcard/ebooks'], } ), # Supernote A5 and A5X @@ -64,8 +65,6 @@ class DeviceDefaults: break if matches: ans = rule[1] - if vid == 0x2080 and pid == 0x000a: - ans['calibre_file_paths'] = {'metadata':'NOOK/metadata.calibre', 'driveinfo':'NOOK/driveinfo.calibre'} return ans, vid, pid return {}, vid, pid diff --git a/src/calibre/devices/nook/driver.py b/src/calibre/devices/nook/driver.py index 84e7703e7f..b37a916c94 100644 --- a/src/calibre/devices/nook/driver.py +++ b/src/calibre/devices/nook/driver.py @@ -86,10 +86,12 @@ class NOOK_COLOR(NOOK): 0x002, 0x003, 0x004, 0x005, # Nook HD+ 0x007, # Glowlight from 2013 + # 0xa, # Glowlight from 2016 is MTP based device 0xb, # Glowlight from 2017 0xc, # Glowlight from 2019 0xd, # Glowlight from 2021 - 0xe, # Glowlight from 2021 + 0xe, # Glowlight from 2022 + # 0xf, # Glowlight from 2023 is MTP based device ] BCD = [0x216, 0x9999, 0x409, 0x440]