mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-11 09:08:32 +02:00
[Dayone] maintain existing tags stored in Dayone metadata
This commit is contained in:
parent
ccaca2d135
commit
8721ff819f
1 changed files with 5 additions and 2 deletions
|
@ -66,7 +66,7 @@ class DayOne(Journal.Journal):
|
|||
entry.uuid = uuid.uuid1().hex
|
||||
|
||||
filename = os.path.join(self.config['journal'], "entries", entry.uuid.upper() + ".doentry")
|
||||
|
||||
|
||||
entry_plist = {
|
||||
'Creation Date': utc_time,
|
||||
'Starred': entry.starred if hasattr(entry, 'starred') else False,
|
||||
|
@ -127,10 +127,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