Fix metadata enhancement crash when album_info is None

Playlist and single track downloads pass None as album_info to
_enhance_file_metadata. The downstream _extract_spotify_metadata
called .get() on it without a null guard, crashing with AttributeError.
This commit is contained in:
Broque Thomas 2026-04-18 18:12:39 -07:00
parent f5a2d51d4e
commit 2c15d50bff

View file

@ -19078,6 +19078,8 @@ def _generate_lrc_file(file_path: str, context: dict, artist: dict, album_info:
def _extract_spotify_metadata(context: dict, artist: dict, album_info: dict) -> dict:
"""Extracts a comprehensive metadata dictionary from the provided context."""
metadata = {}
if album_info is None:
album_info = {}
original_search = context.get("original_search_result", {})
spotify_album = context.get("spotify_album")