From d96a288f9cd5606adea3f2dc05112cde5769e573 Mon Sep 17 00:00:00 2001 From: Lev Plyusnin Date: Wed, 5 Apr 2023 19:49:52 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8?= =?UTF-8?q?=20=D1=81=D0=BA=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D1=82=D1=80=D0=B5=D0=BA=D0=BE=D0=B2=20=D1=83=20=D0=BA=D0=BE?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D1=8B=D1=85=20=D0=BE=D1=82=D1=81=D1=83=D1=82?= =?UTF-8?q?=D1=81=D1=82=D0=B2=D1=83=D0=B5=D1=82=20=D0=BF=D0=BE=D0=BB=D0=B5?= =?UTF-8?q?=20'year'=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 0e3ec23..daecfeb 100644 --- a/main.py +++ b/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)