mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
[Dayone] maintain metadata on edited entries;
Fixes #358, See also #159
This commit is contained in:
parent
7d3afd811b
commit
71329a7cab
1 changed files with 18 additions and 0 deletions
|
@ -184,8 +184,26 @@ class DayOne(Journal.Journal):
|
|||
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))
|
||||
|
||||
# extended Dayone metadata
|
||||
if hasattr(match, "creator_device_agent"):
|
||||
entry.creator_device_agent = match.creator_device_agent
|
||||
if hasattr(match, "creator_generation_date"):
|
||||
entry.creator_generation_date = match.creator_generation_date
|
||||
if hasattr(match, "creator_host_name"):
|
||||
entry.creator_host_name = match.creator_host_name
|
||||
if hasattr(match, "creator_os_agent"):
|
||||
entry.creator_os_agent = match.creator_os_agent
|
||||
if hasattr(match, "creator_software_agent"):
|
||||
entry.creator_software_agent = match.creator_software_agent
|
||||
if hasattr(match, 'location'):
|
||||
entry.location = match.location
|
||||
if hasattr(match, 'weather'):
|
||||
entry.weather = match.weather
|
||||
|
||||
if match != entry:
|
||||
self.entries.remove(match)
|
||||
entry.modified = True
|
||||
|
|
Loading…
Add table
Reference in a new issue