This commit is contained in:
GRiker 2010-06-15 07:36:18 -06:00
parent 214a35e174
commit 20da708539
2 changed files with 12 additions and 9 deletions

Binary file not shown.

View File

@ -884,7 +884,7 @@ class ITUNES(DevicePlugin):
connected_device = self.sources['iPod'] connected_device = self.sources['iPod']
device = self.iTunes.sources.ItemByName(connected_device) device = self.iTunes.sources.ItemByName(connected_device)
added = None db_added = None
for pl in device.Playlists: for pl in device.Playlists:
if pl.Kind == self.PlaylistKind.index('User') and \ if pl.Kind == self.PlaylistKind.index('User') and \
pl.SpecialKind == self.PlaylistSpecialKind.index('Books'): pl.SpecialKind == self.PlaylistSpecialKind.index('Books'):
@ -1161,12 +1161,12 @@ class ITUNES(DevicePlugin):
else: else:
if DEBUG: if DEBUG:
self.log.info(" adding tracer to empty Books|Playlist") self.log.info(" adding tracer to empty Books|Playlist")
fpath = P('tracer.epub') try:
metadata = {'title':'Tracer','author':'calibre'} added = pl.add(appscript.mactypes.File(P('tracer.epub')),to=pl)
added = self._add_device_book(fpath,metadata) time.sleep(0.5)
if added_ added.delete()
self.manual_sync_mode = True self.manual_sync_mode = True
else: except:
self.manual_sync_mode = False self.manual_sync_mode = False
elif iswindows: elif iswindows:
@ -1195,15 +1195,18 @@ class ITUNES(DevicePlugin):
self.log.info(" iTunes.manual_sync_mode: %s" % self.manual_sync_mode) self.log.info(" iTunes.manual_sync_mode: %s" % self.manual_sync_mode)
else: else:
if DEBUG: 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: try:
added = pl.add(appscript.mactypes.File(P('tracer.epub')),to=pl) added = self._add_device_book(fpath,mi)
time.sleep(0.5) time.sleep(0.5)
added.delete() added.Delete()
self.manual_sync_mode = True self.manual_sync_mode = True
except: except:
self.manual_sync_mode = False self.manual_sync_mode = False
self.log.info(" iTunes.manual_sync_mode: %s" % self.manual_sync_mode) self.log.info(" iTunes.manual_sync_mode: %s" % self.manual_sync_mode)
def _dump_booklist(self, booklist, header=None): def _dump_booklist(self, booklist, header=None):