Ignore AppleDouble files on ebook device

When macOS sends file to e-reader device, it also sends a AppleDouble
format file has the same name with "._" prefix. Ignore these files so
they won't be added to the device metadata file.
This commit is contained in:
xxyzz 2023-02-04 15:57:28 +08:00
parent 5160369cb4
commit 4ef38e686c
No known key found for this signature in database
GPG Key ID: F796163E6DCFEE9D

View File

@ -239,6 +239,9 @@ class USBMS(CLI, Device):
def update_booklist(filename, path, prefix): def update_booklist(filename, path, prefix):
changed = False changed = False
# Ignore AppleDouble files
if filename.startswith("._"):
return False
if path_to_ext(filename) in all_formats and self.is_allowed_book_file(filename, path, prefix): if path_to_ext(filename) in all_formats and self.is_allowed_book_file(filename, path, prefix):
try: try:
lpath = os.path.join(path, filename).partition(self.normalize_path(prefix))[2] lpath = os.path.join(path, filename).partition(self.normalize_path(prefix))[2]