diff --git a/beets/importer.py b/beets/importer.py index f997770c4..16522e4db 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -563,8 +563,7 @@ def read_tasks(session): for toppath in session.paths: # Check whether the path is to a file. - if config['import']['singletons'] and \ - not os.path.isdir(syspath(toppath)): + if not os.path.isdir(syspath(toppath)): try: item = library.Item.from_path(toppath) except mediafile.UnreadableFileError: @@ -572,7 +571,10 @@ def read_tasks(session): util.displayable_path(toppath) )) continue - yield ImportTask.item_task(item) + if config['import']['singletons']: + yield ImportTask.item_task(item) + else: + yield ImportTask(toppath, [toppath], [item]) continue # A flat album import merges all items into one album. diff --git a/beets/ui/commands.py b/beets/ui/commands.py index e7e631a49..4d0578cd5 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -746,12 +746,8 @@ def import_files(lib, paths, query): """ # Check the user-specified directories. for path in paths: - fullpath = syspath(normpath(path)) - if not config['import']['singletons'] and not os.path.isdir(fullpath): - raise ui.UserError(u'not a directory: {0}'.format( - displayable_path(path))) - elif config['import']['singletons'] and not os.path.exists(fullpath): - raise ui.UserError(u'no such file: {0}'.format( + if not os.path.exists(syspath(normpath(path))): + raise ui.UserError(u'no such file or directory: {0}'.format( displayable_path(path))) # Check parameter consistency. diff --git a/docs/changelog.rst b/docs/changelog.rst index b5e4e47a5..375e4e326 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -36,6 +36,8 @@ New stuff: example: ``beet modify artist:beatles oldies!`` deletes the ``oldies`` flexible attribute from the database, for the matching items. Thanks to brilnius. +* The :ref:`import-cmd` command can now accept individual files as arguments + even in non-singleton mode. Files are imported as one-track albums. Fixes: