fromfilename: Don't crash if title is missing (#5907)

Prevent crash if title is removed from database by black magic.
This commit is contained in:
Sebastian Mohr 2025-09-18 15:03:56 +02:00 committed by GitHub
commit c265bd7727
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -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:

View file

@ -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: