From 45e78473b0ede6115ee58757db423a9b0f555f24 Mon Sep 17 00:00:00 2001 From: ShimmerGlass Date: Thu, 7 May 2026 08:51:58 +0200 Subject: [PATCH] feat(import): add --nomove / -M option --- beets/ui/commands/import_/__init__.py | 7 +++++++ docs/changelog.rst | 2 ++ docs/guides/tagger.rst | 2 ++ docs/reference/cli.rst | 13 +++++++++---- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/beets/ui/commands/import_/__init__.py b/beets/ui/commands/import_/__init__.py index b2991f183..a839b65cf 100644 --- a/beets/ui/commands/import_/__init__.py +++ b/beets/ui/commands/import_/__init__.py @@ -181,6 +181,13 @@ import_cmd.parser.add_option( dest="move", help="move tracks into the library (overrides -c)", ) +import_cmd.parser.add_option( + "-M", + "--nomove", + action="store_false", + dest="move", + help="don't move tracks into the library (overrides -m)", +) import_cmd.parser.add_option( "-w", "--write", diff --git a/docs/changelog.rst b/docs/changelog.rst index 1a9f57be2..853080f35 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -14,6 +14,8 @@ New features - :doc:`plugins/convert`: The ``--force`` and ``--keep-new`` CLI flags are now also available as config options via ``force`` and ``keep_new``. +- :ref:`import-cmd`: The ``--nomove`` / ``-M`` CLI flag can now be used to + override the ``move: yes`` config option during import. .. Bug fixes diff --git a/docs/guides/tagger.rst b/docs/guides/tagger.rst index 4231f3362..832437807 100644 --- a/docs/guides/tagger.rst +++ b/docs/guides/tagger.rst @@ -98,6 +98,8 @@ command-line options you should know: them where they are - ``beet import -m``: move imported files to your music directory (overrides the ``-c`` option) +- ``beet import -M``: don't move imported files to your music directory + (overrides the ``-m`` option) - ``beet import -l LOGFILE``: write a message to ``LOGFILE`` every time you skip an album or choose to take its tags "as-is" (see below) or the album is skipped as a duplicate; this lets you come back later and reexamine albums diff --git a/docs/reference/cli.rst b/docs/reference/cli.rst index 5457bff07..433c6d9d4 100644 --- a/docs/reference/cli.rst +++ b/docs/reference/cli.rst @@ -46,7 +46,7 @@ import :: - beet import [-CWAPRqst] [-l LOGPATH] PATH... + beet import [-CMWAPRqst] [-l LOGPATH] PATH... beet import [options] -L QUERY Add music to your library, attempting to get correct tags for it from @@ -73,9 +73,9 @@ Optional command flags: ID3 tags on your music. In order to move the files, instead of copying, use the ``-m`` (move) option. When importing an archive with ``-m``, if all files are imported, the archive is removed from disk. If you'd like to leave your - music files untouched, try the ``-C`` (don't copy) and ``-W`` (don't write - tags) options. You can also disable this behavior by default in the - configuration file (below). + music files untouched, try the ``-C`` (don't copy), ``-M`` (don't move), and + ``-W`` (don't write tags) options. You can also disable this behavior by + default in the configuration file (below). - Also, you can disable the autotagging behavior entirely using ``-A`` (don't autotag)---then your music will be imported with its existing metadata. - During a long tagging import, it can be useful to keep track of albums that @@ -175,6 +175,11 @@ Optional command flags: structure will be updated to reflect the new tags if copying is enabled; you never end up with two copies of the file. + Using ``-C`` (don't copy) in combination with ``-M`` (don't move) will retag + music while leaving the files where they are. This is useful for players/music + servers that get confused when an item changes path and tags at the same time. + One can later use the :ref:`move-cmd` command to move items based on their new tags. + The ``-L`` (``--library``) flag is also useful for retagging. Instead of listing paths you want to import on the command line, specify a :doc:`query string ` that matches items from your library. In this case, the