From b6c27b73597ae7e47b6b6e591476de7236498e40 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 25 Mar 2010 08:21:13 +0530 Subject: [PATCH] SONY driver: Tags within [] do not translate into a category --- src/calibre/devices/prs505/books.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/calibre/devices/prs505/books.py b/src/calibre/devices/prs505/books.py index 623f6c19ad..9d943bd8e6 100644 --- a/src/calibre/devices/prs505/books.py +++ b/src/calibre/devices/prs505/books.py @@ -226,11 +226,19 @@ class BookList(_BookList): for item in collections: item = item.strip() mitem = getattr(mi, item, None) + titems = [] if mitem: if isinstance(mitem, list): - tags.extend(mitem) + titems = mitem else: - tags.append(mitem) + titems = [mitem] + if item == 'tags' and titems: + litems = [] + for i in titems: + if not i.strip().startswith('[') and not i.strip().endswith(']'): + litems.append(i) + titems = litems + tags.extend(titems) if tags: tags = list(set(tags)) if hasattr(mi, 'tag_order'):