From 8e2c1bbe68286f167982e921853001a7038dce32 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Mon, 14 Oct 2013 21:11:40 -0700 Subject: [PATCH] ftintitle: check artist_sort for null (fix #418) --- beetsplug/ftintitle.py | 6 ++++-- docs/changelog.rst | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/beetsplug/ftintitle.py b/beetsplug/ftintitle.py index 9afdb801c..af716a9da 100644 --- a/beetsplug/ftintitle.py +++ b/beetsplug/ftintitle.py @@ -49,13 +49,15 @@ def contains_feat(title): def update_metadata(item, feat_part): - """Choose how to add new artists to the title and write the new + """Choose how to add new artists to the title and set the new metadata. Also, print out messages about any changes that are made. """ # In all cases, update the artist fields. ui.print_(u'artist: {0} -> {1}'.format(item.artist, item.albumartist)) item.artist = item.albumartist - item.artist_sort, _ = split_on_feat(item.artist_sort) # Strip featured. + if item.artist_sort: + # Just strip the featured artist from the sort name. + item.artist_sort, _ = split_on_feat(item.artist_sort) # Only update the title if it does not already contain a featured # artist. diff --git a/docs/changelog.rst b/docs/changelog.rst index b1819eeae..2f3406dbb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,6 +8,7 @@ Little fixes: * :doc:`/plugins/missing`: Avoid a possible error when an album's ``tracktotal`` field is missing. +* :doc:`/plugins/ftintitle`: Fix an error when the sort artist is missing. 1.3.1 (October 12, 2013) ------------------------