polar: extract book tags
This commit is contained in:
parent
759b0e1324
commit
844ebf28c1
1 changed files with 6 additions and 1 deletions
|
@ -76,6 +76,8 @@ class Book(NamedTuple):
|
|||
# think about it later.
|
||||
items: Sequence[Highlight]
|
||||
|
||||
tags: Sequence[str]
|
||||
|
||||
@property
|
||||
def filename(self) -> str:
|
||||
# TODO deprecate
|
||||
|
@ -188,9 +190,11 @@ class Loader:
|
|||
added = di['added']
|
||||
filename = di['filename'] # TODO here
|
||||
title = di.get('title', None)
|
||||
tags = di['tags']
|
||||
tags_dict = di['tags']
|
||||
pm = j['pageMetas']
|
||||
|
||||
# todo defensive?
|
||||
tags = tuple(t['label'] for t in tags_dict.values())
|
||||
|
||||
path = Path(config.polar_dir) / 'stash' / filename
|
||||
|
||||
|
@ -200,6 +204,7 @@ class Loader:
|
|||
path=path,
|
||||
title=title,
|
||||
items=list(self.load_items(pm)),
|
||||
tags=tags,
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue