Исправление ошибки скачивания треков у которых отсутствует поле 'year' (#10)
This commit is contained in:
parent
42a2440726
commit
d96a288f9c
1 changed files with 2 additions and 2 deletions
4
main.py
4
main.py
|
|
@ -62,7 +62,7 @@ class BasicAlbumInfo:
|
|||
id: str
|
||||
title: str
|
||||
release_date: Optional[dt.datetime]
|
||||
year: int
|
||||
year: Optional[int]
|
||||
artists: list[str]
|
||||
|
||||
@staticmethod
|
||||
|
|
@ -75,7 +75,7 @@ class BasicAlbumInfo:
|
|||
release_date = json.get('releaseDate')
|
||||
if release_date is not None:
|
||||
release_date = dt.datetime.fromisoformat(release_date)
|
||||
return BasicAlbumInfo(id=json['id'], title=title, year=json['year'],
|
||||
return BasicAlbumInfo(id=json['id'], title=title, year=json.get('year'),
|
||||
artists=artists, release_date=release_date)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue