mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
29d33a770c
@ -1130,6 +1130,7 @@ class ITUNES(DriverBase):
|
|||||||
metadata[i].uuid))
|
metadata[i].uuid))
|
||||||
self.cached_books[this_book.path] = {
|
self.cached_books[this_book.path] = {
|
||||||
'author': authors_to_string(metadata[i].authors),
|
'author': authors_to_string(metadata[i].authors),
|
||||||
|
'authors': metadata[i].authors,
|
||||||
'dev_book': db_added,
|
'dev_book': db_added,
|
||||||
'format': format,
|
'format': format,
|
||||||
'lib_book': lb_added,
|
'lib_book': lb_added,
|
||||||
@ -1176,6 +1177,7 @@ class ITUNES(DriverBase):
|
|||||||
metadata[i].uuid))
|
metadata[i].uuid))
|
||||||
self.cached_books[this_book.path] = {
|
self.cached_books[this_book.path] = {
|
||||||
'author': authors_to_string(metadata[i].authors),
|
'author': authors_to_string(metadata[i].authors),
|
||||||
|
'authors': metadata[i].authors,
|
||||||
'dev_book': db_added,
|
'dev_book': db_added,
|
||||||
'format': format,
|
'format': format,
|
||||||
'lib_book': lb_added,
|
'lib_book': lb_added,
|
||||||
@ -1393,21 +1395,18 @@ class ITUNES(DriverBase):
|
|||||||
db_added = None
|
db_added = None
|
||||||
lb_added = None
|
lb_added = None
|
||||||
|
|
||||||
# If using iTunes_local_storage, copy the file, redirect iTunes to use local copy
|
|
||||||
if not self.settings().extra_customization[self.USE_ITUNES_STORAGE]:
|
|
||||||
local_copy = os.path.join(self.iTunes_local_storage, str(metadata.uuid) + os.path.splitext(fpath)[1])
|
|
||||||
shutil.copyfile(fpath, local_copy)
|
|
||||||
fpath = local_copy
|
|
||||||
|
|
||||||
if self.manual_sync_mode:
|
if self.manual_sync_mode:
|
||||||
'''
|
'''
|
||||||
Unsupported direct-connect mode.
|
DC mode. Add to iBooks only.
|
||||||
'''
|
'''
|
||||||
db_added = self._add_device_book(fpath, metadata)
|
db_added = self._add_device_book(fpath, metadata)
|
||||||
lb_added = self._add_library_book(fpath, metadata)
|
|
||||||
if not lb_added and DEBUG:
|
|
||||||
logger().warn(" failed to add '%s' to iTunes, iTunes Media folder inaccessible" % metadata.title)
|
|
||||||
else:
|
else:
|
||||||
|
# If using iTunes_local_storage, copy the file, redirect iTunes to use local copy
|
||||||
|
if not self.settings().extra_customization[self.USE_ITUNES_STORAGE]:
|
||||||
|
local_copy = os.path.join(self.iTunes_local_storage, str(metadata.uuid) + os.path.splitext(fpath)[1])
|
||||||
|
shutil.copyfile(fpath, local_copy)
|
||||||
|
fpath = local_copy
|
||||||
|
|
||||||
lb_added = self._add_library_book(fpath, metadata)
|
lb_added = self._add_library_book(fpath, metadata)
|
||||||
if not lb_added:
|
if not lb_added:
|
||||||
raise UserFeedback("iTunes Media folder inaccessible",
|
raise UserFeedback("iTunes Media folder inaccessible",
|
||||||
@ -3118,7 +3117,7 @@ class ITUNES(DriverBase):
|
|||||||
|
|
||||||
def _wait_for_writable_metadata(self, db_added, delay=2.0):
|
def _wait_for_writable_metadata(self, db_added, delay=2.0):
|
||||||
'''
|
'''
|
||||||
Ensure iDevice metadata is writable. Direct connect mode only
|
Ensure iDevice metadata is writable. DC mode only
|
||||||
'''
|
'''
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
logger().info(" %s._wait_for_writable_metadata()" % self.__class__.__name__)
|
logger().info(" %s._wait_for_writable_metadata()" % self.__class__.__name__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user