don't automatically update modified when updating it explicitly
This commit is contained in:
@@ -425,7 +425,7 @@ impl<'r> TaskMut<'r> {
|
|||||||
|
|
||||||
// -- utility functions
|
// -- utility functions
|
||||||
|
|
||||||
fn lastmod(&mut self) -> anyhow::Result<()> {
|
fn update_modified(&mut self) -> anyhow::Result<()> {
|
||||||
if !self.updated_modified {
|
if !self.updated_modified {
|
||||||
let now = format!("{}", Utc::now().timestamp());
|
let now = format!("{}", Utc::now().timestamp());
|
||||||
trace!("task {}: set property modified={:?}", self.task.uuid, now);
|
trace!("task {}: set property modified={:?}", self.task.uuid, now);
|
||||||
@@ -443,7 +443,10 @@ impl<'r> TaskMut<'r> {
|
|||||||
value: Option<String>,
|
value: Option<String>,
|
||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let property = property.into();
|
let property = property.into();
|
||||||
self.lastmod()?;
|
// updated the modified timestamp unless we are setting it explicitly
|
||||||
|
if &property != "modified" {
|
||||||
|
self.update_modified()?;
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(ref v) = value {
|
if let Some(ref v) = value {
|
||||||
trace!("task {}: set property {}={:?}", self.task.uuid, property, v);
|
trace!("task {}: set property {}={:?}", self.task.uuid, property, v);
|
||||||
|
|||||||
Reference in New Issue
Block a user