Skip to content

Commit

Permalink
Use library book filename to create sidecar folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyzz committed Mar 30, 2024
1 parent 3017123 commit c6f8564
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions data/deps.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"cupy": "12.3.0",
"lxml": "5.1.0",
"rapidfuzz": "3.6.2",
"lxml": "5.1.1",
"rapidfuzz": "3.7.0",
"spacy": "3.7.4",
"spacy_cpu_model": "3.7.0",
"spacy_trf_model": "3.7.2",
"thinc-apple-ops": "0.1.4",
"torch": "2.2.1",
"torch": "2.2.2",
"typing-extensions": "4.10.0"
}
11 changes: 6 additions & 5 deletions send_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,18 @@ def move_files_to_kindle(self, device_manager: Any, device_book_path: Path) -> N
None,
device_manager if use_mtp else None,
)
sidecar_folder = device_book_path.parent.joinpath(
f"{device_book_path.stem}.sdr"
# Use library book filename, calibre API returns lowercase name for MTP device
sidecar_folder = (
device_book_path.parent / f"{Path(self.job_data.book_path).stem}.sdr"
)
if use_mtp:
for file_path in (self.ll_path, self.x_ray_path):
dest_path = sidecar_folder.joinpath(file_path.name)
dest_path = sidecar_folder / file_path.name
upload_file_to_mtp(device_manager, file_path, dest_path)
else:
sidecar_folder = device_mount_point.joinpath(sidecar_folder)
sidecar_folder = device_mount_point / sidecar_folder
for file_path in (self.ll_path, self.x_ray_path):
dest_path = sidecar_folder.joinpath(file_path.name)
dest_path = sidecar_folder / file_path.name
move_file_to_kindle_usbms(file_path, dest_path)

def push_files_to_android(self, adb_path: str) -> None:
Expand Down

0 comments on commit c6f8564

Please sign in to comment.