mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-01 16:13:21 +02:00
GwR wip
This commit is contained in:
parent
214a35e174
commit
20da708539
2 changed files with 12 additions and 9 deletions
Binary file not shown.
|
|
@ -884,7 +884,7 @@ def _add_device_book(self,fpath, metadata):
|
|||
connected_device = self.sources['iPod']
|
||||
device = self.iTunes.sources.ItemByName(connected_device)
|
||||
|
||||
added = None
|
||||
db_added = None
|
||||
for pl in device.Playlists:
|
||||
if pl.Kind == self.PlaylistKind.index('User') and \
|
||||
pl.SpecialKind == self.PlaylistSpecialKind.index('Books'):
|
||||
|
|
@ -1161,12 +1161,12 @@ def _discover_manual_sync_mode(self, wait=0):
|
|||
else:
|
||||
if DEBUG:
|
||||
self.log.info(" adding tracer to empty Books|Playlist")
|
||||
fpath = P('tracer.epub')
|
||||
metadata = {'title':'Tracer','author':'calibre'}
|
||||
added = self._add_device_book(fpath,metadata)
|
||||
if added_
|
||||
try:
|
||||
added = pl.add(appscript.mactypes.File(P('tracer.epub')),to=pl)
|
||||
time.sleep(0.5)
|
||||
added.delete()
|
||||
self.manual_sync_mode = True
|
||||
else:
|
||||
except:
|
||||
self.manual_sync_mode = False
|
||||
|
||||
elif iswindows:
|
||||
|
|
@ -1195,15 +1195,18 @@ def _discover_manual_sync_mode(self, wait=0):
|
|||
self.log.info(" iTunes.manual_sync_mode: %s" % self.manual_sync_mode)
|
||||
else:
|
||||
if DEBUG:
|
||||
self.log.info(" adding tracer to empty Books|Playlist")
|
||||
self.log.info(" sending tracer to empty Books|Playlist")
|
||||
fpath = P('tracer.epub')
|
||||
mi = MetaInformation('Tracer',['calibre'])
|
||||
try:
|
||||
added = pl.add(appscript.mactypes.File(P('tracer.epub')),to=pl)
|
||||
added = self._add_device_book(fpath,mi)
|
||||
time.sleep(0.5)
|
||||
added.delete()
|
||||
added.Delete()
|
||||
self.manual_sync_mode = True
|
||||
except:
|
||||
self.manual_sync_mode = False
|
||||
|
||||
|
||||
self.log.info(" iTunes.manual_sync_mode: %s" % self.manual_sync_mode)
|
||||
|
||||
def _dump_booklist(self, booklist, header=None):
|
||||
|
|
|
|||
Loading…
Reference in a new issue