From 8bcbe1dea211a7c4e78c7285b7a4846739bc28d7 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 20 Aug 2013 16:22:24 -0700 Subject: [PATCH] fix outdated SQL query --- beets/library.py | 2 +- test/test_files.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/beets/library.py b/beets/library.py index 1b08cb571..77a7051c3 100644 --- a/beets/library.py +++ b/beets/library.py @@ -1420,7 +1420,7 @@ class Library(object): # Flexible attributes. flexins = 'INSERT INTO item_attributes ' \ ' (entity_id, key, value)' \ - ' VALUES (?, ?, ?, ?)' + ' VALUES (?, ?, ?)' for key, value in item._values_flex.items(): if value is not None: tx.mutate(flexins, (new_id, key, value)) diff --git a/test/test_files.py b/test/test_files.py index a9aad0f95..7abbec94b 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -170,6 +170,7 @@ class AlbumFileTest(_common.TestCase): def test_albuminfo_move_changes_paths(self): self.ai.album = 'newAlbumName' self.ai.move() + self.ai.store() self.lib.load(self.i) self.assert_('newAlbumName' in self.i.path) @@ -178,6 +179,7 @@ class AlbumFileTest(_common.TestCase): oldpath = self.i.path self.ai.album = 'newAlbumName' self.ai.move() + self.ai.store() self.lib.load(self.i) self.assertFalse(os.path.exists(oldpath)) @@ -187,6 +189,7 @@ class AlbumFileTest(_common.TestCase): oldpath = self.i.path self.ai.album = 'newAlbumName' self.ai.move(True) + self.ai.store() self.lib.load(self.i) self.assertTrue(os.path.exists(oldpath)) @@ -195,6 +198,7 @@ class AlbumFileTest(_common.TestCase): def test_albuminfo_move_to_custom_dir(self): self.ai.move(basedir=self.otherdir) self.lib.load(self.i) + self.ai.store() self.assertTrue('testotherdir' in self.i.path) class ArtFileTest(_common.TestCase): @@ -216,6 +220,7 @@ class ArtFileTest(_common.TestCase): self.art = self.lib.get_album(self.i).art_destination('something.jpg') touch(self.art) self.ai.artpath = self.art + self.ai.store() # Alternate destination dir. self.otherdir = os.path.join(self.temp_dir, 'testotherdir') @@ -239,6 +244,7 @@ class ArtFileTest(_common.TestCase): def test_art_moves_with_album_to_custom_dir(self): # Move the album to another directory. self.ai.move(basedir=self.otherdir) + self.ai.store() self.lib.load(self.i) # Art should be in new directory.