mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 16:42:42 +01:00
importadded: adapt doc for new option preserve_write_mtimes
This commit is contained in:
parent
8ef36198fb
commit
e5be804802
3 changed files with 15 additions and 6 deletions
|
|
@ -124,8 +124,8 @@ class ImportAddedPlugin(BeetsPlugin):
|
||||||
item.store()
|
item.store()
|
||||||
|
|
||||||
def update_after_write_time(self, item):
|
def update_after_write_time(self, item):
|
||||||
"""Update the mtime of the item's file with the item.added value
|
"""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.
|
after each write of the item if `preserve_write_mtimes` is enabled.
|
||||||
"""
|
"""
|
||||||
if item.added:
|
if item.added:
|
||||||
if self.config['preserve_write_mtimes'].get(bool):
|
if self.config['preserve_write_mtimes'].get(bool):
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ New features:
|
||||||
|
|
||||||
* :doc:`/plugins/convert`: A new `album_art_maxwidth` lets you resize album
|
* :doc:`/plugins/convert`: A new `album_art_maxwidth` lets you resize album
|
||||||
art while copying it.
|
art while copying it.
|
||||||
|
* :doc:`/plugins/importadded`: A new `preserve_write_mtimes` option
|
||||||
|
lets you preserve mtime of files after each write.
|
||||||
|
|
||||||
Fixes:
|
Fixes:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.
|
set to the oldest mtime of the files in the album before they were imported.
|
||||||
The mtime of album directories is ignored.
|
The mtime of album directories is ignored.
|
||||||
|
|
||||||
This plugin can optionally be configured to also preserve mtimes using the
|
This plugin can optionally be configured to also preserve mtimes at
|
||||||
``preserve_mtimes`` option.
|
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:
|
File modification times are preserved as follows:
|
||||||
|
|
||||||
|
|
@ -40,9 +43,13 @@ Configuration
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
To configure the plugin, make an ``importadded:`` section in your
|
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.
|
original value.
|
||||||
Default: ``no``.
|
Default: ``no``.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue