From e916609eeec4a410702324d339988abbe60e55ba Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Tue, 4 Mar 2014 17:12:42 +0100 Subject: [PATCH] Save import history only when path associated Fixes #570 --- beets/importer.py | 2 +- test/test_importer.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/beets/importer.py b/beets/importer.py index 68d6b566e..23a9c2405 100644 --- a/beets/importer.py +++ b/beets/importer.py @@ -454,7 +454,7 @@ class ImportTask(object): def save_history(self): """Save the directory in the history for incremental imports. """ - if self.is_album and not self.sentinel: + if self.is_album and self.paths and not self.sentinel: history_add(self.paths) diff --git a/test/test_importer.py b/test/test_importer.py index 42d15b19e..d321671ce 100644 --- a/test/test_importer.py +++ b/test/test_importer.py @@ -729,6 +729,15 @@ class GroupAlbumsImportTest(_common.TestCase, ImportHelper): artists = set([album.albumartist for album in self.lib.albums()]) self.assertEqual(artists, set(['Artist B', 'Tag Artist'])) + def test_incremental(self): + config['import']['incremental'] = True + self.import_media[0].album = "Album B" + self.import_media[0].save() + + self.importer.run() + albums = set([album.album for album in self.lib.albums()]) + self.assertEqual(albums, set(['Album B', 'Tag Album'])) + class GlobalGroupAlbumsImportTest(GroupAlbumsImportTest): def setUp(self):