From e5be804802d6a11e9e5e0b8c25ba17999fd2f95c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Tissi=C3=A8res?= Date: Tue, 22 Mar 2016 06:24:09 +0100 Subject: [PATCH] importadded: adapt doc for new option preserve_write_mtimes --- beetsplug/importadded.py | 4 ++-- docs/changelog.rst | 2 ++ docs/plugins/importadded.rst | 15 +++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/beetsplug/importadded.py b/beetsplug/importadded.py index 71ead7193..77c7e7ab8 100644 --- a/beetsplug/importadded.py +++ b/beetsplug/importadded.py @@ -124,8 +124,8 @@ class ImportAddedPlugin(BeetsPlugin): item.store() def update_after_write_time(self, item): - """Update the mtime of the item's file with the item.added value - after each write of the item if `preserve_write_mtimes` is enabled. + """Update the mtime of the item's file with the item.added value + after each write of the item if `preserve_write_mtimes` is enabled. """ if item.added: if self.config['preserve_write_mtimes'].get(bool): diff --git a/docs/changelog.rst b/docs/changelog.rst index 9cc53ac97..f3460cfde 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,6 +8,8 @@ New features: * :doc:`/plugins/convert`: A new `album_art_maxwidth` lets you resize album art while copying it. +* :doc:`/plugins/importadded`: A new `preserve_write_mtimes` option + lets you preserve mtime of files after each write. Fixes: diff --git a/docs/plugins/importadded.rst b/docs/plugins/importadded.rst index 677879da8..2a2e8ea29 100644 --- a/docs/plugins/importadded.rst +++ b/docs/plugins/importadded.rst @@ -22,8 +22,11 @@ The ``item.added`` field is populated as follows: set to the oldest mtime of the files in the album before they were imported. The mtime of album directories is ignored. -This plugin can optionally be configured to also preserve mtimes using the -``preserve_mtimes`` option. +This plugin can optionally be configured to also preserve mtimes at +import using the ``preserve_mtimes`` option. + +When ``preserve_write_mtimes`` option is set, this plugin preserves +mtimes after each write to files using the ``item.added`` attribute. File modification times are preserved as follows: @@ -40,9 +43,13 @@ Configuration ------------- To configure the plugin, make an ``importadded:`` section in your -configuration file. There is one option available: +configuration file. There are two options available: -- **preserve_mtimes**: After writing files, re-set their mtimes to their +- **preserve_mtimes**: After importing files, re-set their mtimes to their + original value. + Default: ``no``. + +- **preserve_write_mtimes**: After writing files, re-set their mtimes to their original value. Default: ``no``.