Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增 个人收藏电台 #25

Merged
merged 2 commits into from
Oct 5, 2021

Conversation

BruceZhang1993
Copy link
Member

@BruceZhang1993 BruceZhang1993 commented Oct 4, 2021

add netease my radio collection #7

image
image

新增 电台个人收藏
新增 电台详情和列表
新增 电台歌曲播放

剩余问题

  • NSongModel get 拿不到歌曲信息需要通过电台节目详情接口 // 暂时先 allow_get=False
  • 处理显示专辑和歌手名称 // 处理为 歌手显示为上传者用户名 专辑显示为电台标题

@BruceZhang1993 BruceZhang1993 marked this pull request as ready for review October 4, 2021 13:32
Copy link
Member

@cosven cosven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

记了一些后续可以更新的地方。

手动测试的时候发现一些潜在问题,由于 NRadioSongModel 实际上不是 SongModel,所以这些功能有问题:

  1. 拖动
  2. 右键:歌曲详情页面;歌手详情等页面


@fav_djradio.setter
def fav_djradio(self, _):
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以用 cached_field

data = dict(radioId=radio_id, limit=limit, offset=offset, asc=asc)
url = uri_e + '/v1/dj/program/byradio'
payload = self.eapi_encrypt(b'/api/v1/dj/program/byradio', data)
return self.request('POST', url, {'params': payload})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以把 eapi_encrypt + request 两个函数合并成一个函数

@@ -228,6 +231,11 @@ def get_media(self, quality):
return self.q_media_mapping.get(quality)


class NRadioSongModel(NSongModel):
class Meta:
allow_get = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里理论上是有问题的 :一个 provider 只能有一个 type 为 song 的 model,但是这里定义了两个。

@@ -311,6 +319,33 @@ def desc(self, value):
self._desc = value



class NRadioModel(PlaylistModel, NBaseModel):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些接口可能可以迁移为 provider 的接口

@cosven cosven merged commit 71b9cee into feeluown:master Oct 5, 2021
@BruceZhang1993 BruceZhang1993 deleted the feature/netease-my-podcast branch October 6, 2021 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants