From ef9615b9040630627ce08e03474594434e0aaf67 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Wed, 3 Jun 2015 21:37:40 -0600 Subject: [PATCH] [DayOne] maintain existing tags stored in DayOne metadata --- jrnl/DayOneJournal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jrnl/DayOneJournal.py b/jrnl/DayOneJournal.py index d2bb785a..96d21ac7 100644 --- a/jrnl/DayOneJournal.py +++ b/jrnl/DayOneJournal.py @@ -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