Skip to content

Commit

Permalink
修复“搜索->网易精选集” (#772)
Browse files Browse the repository at this point in the history
* 1、修复歌单详情只有一首歌;2、缓存文件路径修改至~/.netseae-musicbox/nemcache.sqlite,而不是当前文件夹下的nemcache.sqlite;3、将旧版的每日推荐歌曲(非歌单)添加至当前版本

* 修复每过20分钟可能出现的播放错误

* 修复切换歌单时可能出现的切换不成功问题。如:当前播放歌曲为歌单1的第3首,想切换至歌单2的第3首时(索引位置一致,都为3),会出现UI歌名发生变化,歌曲却暂停播放、未切换

* 修复搜索歌曲出错

* 修复"搜索->网易精选集"出错
  • Loading branch information
anhoder authored and kigawas committed Nov 27, 2018
1 parent b859a93 commit 445b3e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions NEMbox/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,14 +668,14 @@ def dispatch_enter(self, idx):
self.title += ' > ' + datalist[idx]['albums_name']

# 精选歌单选项
elif datatype == 'playlists':
elif datatype == 'recommend_lists':
data = self.datalist[idx]
self.datatype = data['datatype']
self.datalist = netease.dig_info(data['callback'](), self.datatype)
self.title += ' > ' + data['title']

# 全站置顶歌单包含的歌曲
elif datatype == 'top_playlists':
elif datatype in ['top_playlists', 'playlists']:
playlist_id = datalist[idx]['playlist_id']
songs = netease.playlist_detail(playlist_id)
self.datatype = 'songs'
Expand Down Expand Up @@ -826,7 +826,7 @@ def choice_channel(self, idx):
'callback': lambda: []
}]
self.title += ' > 精选歌单'
self.datatype = 'playlists'
self.datatype = 'recommend_lists'
elif idx == 4:
myplaylist = self.request_api(self.api.user_playlist, self.userid)
self.datatype = 'top_playlists'
Expand Down
4 changes: 2 additions & 2 deletions NEMbox/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def build_menu(self, datatype, title, datalist, offset, index, step,
self.space + datalist[i][
'artists_name'])

elif datatype == 'playlists':
elif datatype == 'recommend_lists':
for i in range(offset, min(len(datalist), offset + step)):
if i == index:
self.addstr(
Expand All @@ -374,7 +374,7 @@ def build_menu(self, datatype, title, datalist, offset, index, step,
i - offset + 9, self.startcol,
str(i) + '. ' + datalist[i]['title'])

elif datatype == 'top_playlists':
elif datatype in ('top_playlists', 'playlists'):
for i in range(offset, min(len(datalist), offset + step)):
if i == index:
self.addstr(
Expand Down

0 comments on commit 445b3e0

Please sign in to comment.