diff --git a/beetsplug/parentwork.py b/beetsplug/parentwork.py index 4520edea2..e03a142d4 100644 --- a/beetsplug/parentwork.py +++ b/beetsplug/parentwork.py @@ -26,7 +26,8 @@ import musicbrainzngs def work_father_id(mb_workid, work_date=None): - """ Given a mb_workid, find the id one of the works the work is part of""" + """ Given a mb_workid, find the id one of the works the work is part of + and the first composition date it encounters. """ work_info = musicbrainzngs.get_work_by_id(mb_workid, includes=["work-rels", "artist-rels"]) @@ -46,7 +47,7 @@ def work_father_id(mb_workid, work_date=None): def work_parent_id(mb_workid): - """Find the parentwork id of a work given its id. """ + """Find the parentwork id and composition date of a work given its id. """ work_date = None while True: new_mb_workid, work_date = work_father_id(mb_workid, work_date) @@ -57,8 +58,8 @@ def work_parent_id(mb_workid): def find_parentwork_info(mb_workid): - """Return the work relationships (dict) of a parentwork given the id of - the work""" + """Return the work relationships (dict) and composition date of a + parentwork given the id of the work""" parent_id, work_date = work_parent_id(mb_workid) work_info = musicbrainzngs.get_work_by_id(parent_id, includes=["artist-rels"]) diff --git a/test/test_parentwork.py b/test/test_parentwork.py index 44545c63e..985723fb5 100644 --- a/test/test_parentwork.py +++ b/test/test_parentwork.py @@ -80,9 +80,9 @@ class ParentWorkTest(unittest.TestCase, TestHelper): def test_father_work(self, command_output): mb_workid = u'2e4a3668-458d-3b2a-8be2-0b08e0d8243a' self.assertEqual(u'f04b42df-7251-4d86-a5ee-67cfa49580d1', - parentwork.work_father(mb_workid)[0]) + parentwork.work_father_id(mb_workid)[0]) self.assertEqual(u'45afb3b2-18ac-4187-bc72-beb1b1c194ba', - parentwork.work_parent(mb_workid)[0]) + parentwork.work_parent_id(mb_workid)[0]) def suite():