From 3407f7cf0dd5ad76e43c94fad891469666bd8aa7 Mon Sep 17 00:00:00 2001 From: GRiker Date: Wed, 12 Jan 2011 07:30:50 -0700 Subject: [PATCH] GwR add support for lists in notes field --- src/calibre/library/catalog.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index 349800c8ba..98cc4b7ecd 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -1524,19 +1524,19 @@ class EPUB_MOBI(CatalogPlugin): this_title['formats'] = formats # Add user notes to be displayed in header - # Special case handling for datetime fields + # Special case handling for datetime fields and lists if self.opts.header_note_source_field: field_md = self.__db.metadata_for_field(self.opts.header_note_source_field) notes = self.__db.get_field(record['id'], self.opts.header_note_source_field, index_is_id=True) - if notes and field_md['datatype'] == 'datetime': - # Reformat date fields to match UI presentation: dd MMM YYYY - notes = format_date(notes,'dd MMM yyyy') - if notes: + if field_md['datatype'] == 'text' and isinstance(notes,list): + notes = ' · '.join(notes) + elif field_md['datatype'] == 'datetime': + notes = format_date(notes,'dd MMM yyyy') this_title['notes'] = {'source':field_md['name'], - 'content':notes} + 'content':notes} titles.append(this_title)