Skip to content
This repository has been archived by the owner on Jun 30, 2019. It is now read-only.

Commit

Permalink
修复 qq 音乐专辑加载失败
Browse files Browse the repository at this point in the history
  • Loading branch information
cosven committed Dec 29, 2018
1 parent 71963bd commit 3f766df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fuocore/qqmusic/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class QQAlbumSchema(Schema):
artist_id = fields.Int(load_from='singerid', required=True)
artist_name = fields.Str(load_from='singername', required=True)

songs = fields.List(fields.Nested(QQSongSchema), load_from='list')
# 有的专辑歌曲列表为 null,比如:fuo://qqmusic/albums/8623
songs = fields.List(fields.Nested(QQSongSchema), load_from='list', allow_none=True)

@post_load
def create_model(self, data):
Expand All @@ -79,7 +80,7 @@ def create_model(self, data):
album = QQAlbumModel(identifier=data['identifier'],
name=data['name'],
desc=data['desc'],
songs=data['songs'],
songs=data['songs'] or [],
artists=[artist])
return album

Expand Down

0 comments on commit 3f766df

Please sign in to comment.