Kobo driver: Fix collections sometimes not displayed in device view

Merge branch 'master' of https://github.com/davidfor/calibre
This commit is contained in:
Kovid Goyal 2017-05-17 19:41:50 +05:30
commit 210a532e17
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 2 deletions

View File

@ -3052,7 +3052,12 @@ class KOBOTOUCH(KOBO):
@property
def collections_columns(self):
return self.get_pref('collections_columns')
return self.get_pref('collections_columns') if self.manage_collections else ''
def get_collections_attributes(self):
collections_str = self.collections_columns
collections = [x.lower().strip() for x in collections_str.split(',')] if collections_str else []
return collections
@property
def delete_empty_collections(self):

View File

@ -113,7 +113,7 @@ SC_FIELDS_NOT_COPIED = frozenset(['title', 'title_sort', 'authors',
'identifiers'])
# Metadata fields that smart update should copy only if the source is not None
SC_FIELDS_COPY_NOT_NULL = frozenset(['lpath', 'size', 'comments', 'thumbnail'])
SC_FIELDS_COPY_NOT_NULL = frozenset(['device_collections', 'lpath', 'size', 'comments', 'thumbnail'])
# Metadata fields that smart update should copy without special handling
SC_COPYABLE_FIELDS = SOCIAL_METADATA_FIELDS.union(