Fix device collections column not being updated when sending book to SONY

This commit is contained in:
Kovid Goyal 2010-05-20 00:24:41 -06:00
parent 702a203013
commit 02c3d52c3e

View File

@ -266,6 +266,8 @@ class XMLCache(object):
def update_booklist(self, bl, bl_index): def update_booklist(self, bl, bl_index):
if bl_index not in self.record_roots: if bl_index not in self.record_roots:
return return
if DEBUG:
prints('Updating JSON cache:', bl_index)
root = self.record_roots[bl_index] root = self.record_roots[bl_index]
pmap = self.get_playlist_map()[bl_index] pmap = self.get_playlist_map()[bl_index]
playlist_map = {} playlist_map = {}
@ -315,7 +317,7 @@ class XMLCache(object):
for i, booklist in booklists.items(): for i, booklist in booklists.items():
if DEBUG: if DEBUG:
prints('Updating booklist:', i) prints('Updating XML Cache:', i)
root = self.record_roots[i] root = self.record_roots[i]
for book in booklist: for book in booklist:
path = os.path.join(self.prefixes[i], *(book.lpath.split('/'))) path = os.path.join(self.prefixes[i], *(book.lpath.split('/')))
@ -329,6 +331,10 @@ class XMLCache(object):
self.fix_ids() self.fix_ids()
# This is needed to update device_collections
for i, booklist in booklists.items():
self.update_booklist(booklist, i)
def update_playlists(self, bl_index, root, booklist, playlist_map, def update_playlists(self, bl_index, root, booklist, playlist_map,
collections_attributes): collections_attributes):
collections = booklist.get_collections(collections_attributes) collections = booklist.get_collections(collections_attributes)