From 61083325e31c8df30b7de07154e33e44b383d80d Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sun, 1 Jun 2014 12:04:16 -0700 Subject: [PATCH] Fix #796: flat import of empty directories --- beets/importer.py | 5 +++-- docs/changelog.rst | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/beets/importer.py b/beets/importer.py index dd1537213..4fd4749ee 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -839,8 +839,9 @@ def read_tasks(session): all_items = [] for _, items in autotag.albums_in_dir(toppath): all_items += items - yield ImportTask(toppath, [toppath], all_items) - yield SentinelImportTask(toppath) + if all_items: + yield ImportTask(toppath, [toppath], all_items) + yield SentinelImportTask(toppath) continue resume_dir = None diff --git a/docs/changelog.rst b/docs/changelog.rst index 539c5b6a7..ed7c88f08 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -30,6 +30,7 @@ Little improvements and fixes: * :doc:`/plugins/play`: Playing albums now generates filenames by default (as opposed to directories) for better compatibility. The ``use_folders`` option restores the old behavior. Thanks to Lucas Duailibe. +* Fix an error when importing an empty directory with the ``--flat`` option. 1.3.6 (May 10, 2014)