From 6f2d9845b50cb756ec5a77ec56bec6b155403916 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 17 Jan 2015 14:20:53 -0800 Subject: [PATCH] Add an assertion for summarize_items (#1232) --- beets/importer.py | 5 ----- beets/ui/commands.py | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/beets/importer.py b/beets/importer.py index deb13fd24..710b1af03 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -464,9 +464,6 @@ class ImportTask(object): """ if self.choice_flag == action.ASIS: return list(self.items) - # FIXME this should be a simple attribute. There should be no - # need to retrieve the keys of `match.mapping`. This requires - # that we remove unmatched items from the list. elif self.choice_flag == action.APPLY: return self.match.mapping.keys() else: @@ -475,8 +472,6 @@ class ImportTask(object): def apply_metadata(self): """Copy metadata from match info to the items. """ - # TODO call should be more descriptive like - # apply_metadata(self.match, self.items) autotag.apply_metadata(self.match.info, self.match.mapping) def duplicate_items(self, lib): diff --git a/beets/ui/commands.py b/beets/ui/commands.py index 2c0863b60..839263fc5 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -419,6 +419,8 @@ def summarize_items(items, singleton): this is an album or single-item import (if the latter, them `items` should only have one element). """ + assert items, "summarizing zero items" + summary_parts = [] if not singleton: summary_parts.append("{0} items".format(len(items)))