From e9e90fa53814ae1b7e429765b1e106be7b2b5025 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 15 Jul 2010 11:22:36 -0700 Subject: [PATCH] expand set of album metadata to include everything relevant --- beets/library.py | 16 +++++++++++++--- test/test_db.py | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/beets/library.py b/beets/library.py index 8c3c5726b..64957bd26 100644 --- a/beets/library.py +++ b/beets/library.py @@ -69,10 +69,20 @@ ITEM_KEYS = [f[0] for f in ITEM_FIELDS] # The third entry in each tuple indicates whether the field reflects an # identically-named field in the items table. ALBUM_FIELDS = [ - ('id', 'integer primary key', False), - ('artist', 'text', True), - ('album', 'text', True), + ('id', 'integer primary key', False), ('artpath', 'text', False), + + ('artist', 'text', True), + ('album', 'text', True), + ('genre', 'text', True), + ('year', 'int', True), + ('month', 'int', True), + ('day', 'int', True), + ('tracktotal', 'int', True), + ('disctotal', 'int', True), + ('comp', 'bool', True), + ('mb_albumid', 'text', True), + ('mb_artistid', 'text', True), ] ALBUM_KEYS = [f[0] for f in ALBUM_FIELDS] ALBUM_KEYS_ITEM = [f[0] for f in ALBUM_FIELDS if f[2]] diff --git a/test/test_db.py b/test/test_db.py index 8bb6a78ee..0082c94b7 100644 --- a/test/test_db.py +++ b/test/test_db.py @@ -337,6 +337,7 @@ class AlbumInfoTest(unittest.TestCase): ai = self.lib.get_album(self.i) self.assertEqual(ai.artist, self.i.artist) self.assertEqual(ai.album, self.i.album) + self.assertEqual(ai.year, self.i.year) def test_albuminfo_stores_art(self): ai = self.lib.get_album(self.i)