diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index b724a963a..a50c3464f 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -1209,12 +1209,18 @@ def _configure(options): # Check whether parental directories exist. +def database_dir_creation(path): + # Ask the user for a choice. + return input_yn("The database directory {} does not \ + exists. Create it (Y/n)?" + .format(util.displayable_path(path))) + + def _check_db_directory_exists(path): if path == b':memory:': # in memory db return newpath = os.path.dirname(path) if not os.path.isdir(newpath): - from beets.ui.commands import database_dir_creation if database_dir_creation(newpath): os.makedirs(newpath) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 1261b1776..a18b09f7d 100755 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -1402,13 +1402,6 @@ default_commands.append(version_cmd) # wants to create the parent directories. -def database_dir_creation(path): - # Ask the user for a choice. - return ui.input_yn("The database directory {} does not \ - exists, create it (Y/n)?" - .format(displayable_path(path))) - - # modify: Declaratively change metadata. def modify_items(lib, mods, dels, query, write, move, album, confirm): diff --git a/docs/changelog.rst b/docs/changelog.rst index fe4afa810..4126a8cce 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,8 +7,9 @@ Changelog Changelog goes here! New features: -* Create the parental directories for database if they do not exist. +* Create the parental directories for database if they do not exist. + :bug:`3808` :bug:`4327` * :ref:`musicbrainz-config`: a new :ref:`musicbrainz.enabled` option allows disabling the MusicBrainz metadata source during the autotagging process * :doc:`/plugins/kodiupdate`: Now supports multiple kodi instances diff --git a/docs/guides/main.rst b/docs/guides/main.rst index feb918570..8dbb113c4 100644 --- a/docs/guides/main.rst +++ b/docs/guides/main.rst @@ -142,8 +142,7 @@ place to start:: Change that first path to a directory where you'd like to keep your music. Then, for ``library``, choose a good place to keep a database file that keeps an index -of your music. Beets will prompt you if the parental directories for database do -not exist. (The config's format is `YAML`_. You'll want to configure your +of your music. (The config's format is `YAML`_. You'll want to configure your text editor to use spaces, not real tabs, for indentation. Also, ``~`` means your home directory in these paths, even on Windows.)