mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-21 05:28:31 +02:00
[DayOne] maintain existing tags stored in DayOne metadata
This commit is contained in:
parent
c78d765621
commit
ef9615b904
1 changed files with 4 additions and 1 deletions
|
@ -158,10 +158,13 @@ class DayOne(Journal.Journal):
|
|||
# Now, update our current entries if they changed
|
||||
for entry in entries:
|
||||
entry._parse_text()
|
||||
matched_entries = [e for e in self.entries if e.uuid.lower() == entry.uuid]
|
||||
matched_entries = [e for e in self.entries if e.uuid.lower() == entry.uuid.lower()]
|
||||
# tags in entry body
|
||||
if matched_entries:
|
||||
# This entry is an existing entry
|
||||
match = matched_entries[0]
|
||||
# merge existing tags with tags pulled from the entry body
|
||||
entry.tags = list(set(entry.tags + match.tags))
|
||||
if match != entry:
|
||||
self.entries.remove(match)
|
||||
entry.modified = True
|
||||
|
|
Loading…
Add table
Reference in a new issue