1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

simplify cover upload on newer MTP based Kindles by replacing EBOK with PDOC (#767)

* simplify covers by replacing ebok with pdoc

* refactor

* fix order
This commit is contained in:
Alex Xu
2024-11-07 21:53:59 -08:00
committed by GitHub
parent 421e6bcb64
commit 78c014bf22
4 changed files with 17 additions and 7 deletions

View File

@@ -19,9 +19,12 @@
import os.path
import psutil
from . import image
class Kindle:
def __init__(self):
def __init__(self, profile):
self.profile = profile
self.path = self.findDevice()
if self.path:
self.coverSupport = self.checkThumbnails()
@@ -29,6 +32,8 @@ class Kindle:
self.coverSupport = False
def findDevice(self):
if self.profile in image.ProfileData.ProfilesKindlePDOC.keys():
return False
for drive in reversed(psutil.disk_partitions(False)):
if (drive[2] == 'FAT32' and drive[3] == 'rw,removable') or \
(drive[2] in ('vfat', 'msdos', 'FAT', 'apfs') and 'rw' in drive[3]):