mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-22 09:56:18 +01:00
PRS505 driver: Tags within [] do not translate into a category.
This commit is contained in:
parent
16c9b7dc1e
commit
a36729be1c
1 changed files with 10 additions and 2 deletions
|
|
@ -226,11 +226,19 @@ def add_book(self, mi, name, collections, size, ctime):
|
|||
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'):
|
||||
|
|
|
|||
Loading…
Reference in a new issue