diff --git a/beetsplug/fromfilename.py b/beetsplug/fromfilename.py index 5e8b338c7..7f9e9b92e 100644 --- a/beetsplug/fromfilename.py +++ b/beetsplug/fromfilename.py @@ -121,7 +121,7 @@ def apply_matches(d, log): # Apply the title and track. for item in d: if bad_title(item.title): - item.title = str(d[item][title_field]) + item.title = str(d[item].get(title_field, "")) log.info("Title replaced with: {.title}", item) if "track" in d[item] and item.track == 0: diff --git a/docs/changelog.rst b/docs/changelog.rst index 4dc38da94..67c284a88 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -83,6 +83,8 @@ Bug fixes: the config option ``deezer.search_query_ascii: yes``. :bug:`5860` - Fixed regression with :doc:`/plugins/listenbrainz` where the plugin could not be loaded :bug:`5975` +- :doc:`/plugins/fromfilename`: Beets will no longer crash if a track's title + field is missing. For packagers: