diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6d1a212..14e7cc3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,4 @@ -v0.4.49 - +v0.4.49 - Maintenance update v0.4.48 - Add 'sub_gain' action - Add 'surround_volume_tv' action - Add 'surround_volume_music' action diff --git a/soco_cli/action_processor.py b/soco_cli/action_processor.py index 0e5461b..e875d5b 100644 --- a/soco_cli/action_processor.py +++ b/soco_cli/action_processor.py @@ -488,6 +488,16 @@ def title_not_useful(title): for item in sorted(track_info): if item not in ["metadata", "uri", "album_art"]: elements[item.capitalize()] = track_info[item] + # If there's no title, look in the metadata + try: + if elements["Title"] == "" or title_not_useful(elements["Title"]): + metadata = parse(track_info["metadata"]) + elements["Title"] = metadata["DIDL-Lite"]["item"]["dc:title"] + logging.info( + "Found title in metadata: {}".format(elements["Title"]) + ) + except KeyError: + pass # Remove blank and 'None' items elements = {