Skip to content

Commit

Permalink
Merge pull request #20 from rwxd/fix/tags-on-new-article
Browse files Browse the repository at this point in the history
fix(readwise): tags will be added to new articles in a single run
  • Loading branch information
rwxd authored Dec 29, 2022
2 parents 7fb69fd + cdad905 commit ace872a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wallabag2readwise/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,11 @@ def push_annotations(wallabag: WallabagConnector, readwise: ReadwiseConnector):
f'==> Adding article "{wallabag_entry.title}" to Readwise'
)
new_highlights(readwise, wallabag_entry, annotations)
for new_articles in readwise.get_books('articles'):
if new_articles.title == wallabag_entry.title:
for tag in wallabag_entry.tags:
console.print(
f'==> Adding tag "{tag.label}" to Readwise article'
)
readwise.add_tag(new_articles.id, tag.label)
break

0 comments on commit ace872a

Please sign in to comment.