diff --git a/spotify_actions/album.py b/spotify_actions/album.py index d0c7e4a..1952acd 100644 --- a/spotify_actions/album.py +++ b/spotify_actions/album.py @@ -75,7 +75,10 @@ def album_sort_release( all_albums = list(albums) def _sort_key(album: SearchAlbum) -> date: - return parse_release_date(album.release_date, album.release_date_precision, fast_forward=fast_forward) + try: + return parse_release_date(album.release_date, album.release_date_precision, fast_forward=fast_forward) + except ValueError: + return date(1970, 1, 1) for album in sorted(all_albums, key=_sort_key, reverse=descending): yield album