like
This commit is contained in:
parent
22ccb5b538
commit
71d47ebbb4
@ -13,6 +13,9 @@ webrtc 实现的 p2p 信道
|
||||
- [x] 分片请求时立即播放
|
||||
- [ ] 上锁防止连续重复加载同一个造成分片混乱
|
||||
- [x] 使用单独的状态标识音乐是否缓存
|
||||
- [x] 取消本地存储时不直接移除列表
|
||||
- [ ] 取消本地存储时检查是否移除(其它成员可能有同一曲)
|
||||
- [ ] 成员列表刷新时播放被重置BUG
|
||||
- [ ] 集群分发
|
||||
- [ ] 下载加速
|
||||
- [ ] 即时通讯
|
||||
|
@ -72,7 +72,7 @@
|
||||
onlike: (item, list) => {
|
||||
console.log('喜欢音乐', item.name)
|
||||
if (item.arrayBuffer) {
|
||||
database.add({ save:true, ...item })
|
||||
database.add(item)
|
||||
clientList.send('base', JSON.stringify({
|
||||
type: 'set_music_list',
|
||||
list: list.map(({ id, name, size, type }) => ({ id, name, size, type }))
|
||||
|
@ -115,8 +115,10 @@ export default class MusicList {
|
||||
event.stopPropagation()
|
||||
if (item.save) {
|
||||
event.target.textContent = '缓存'
|
||||
this.ul.querySelector(`#${item.id}`).classList.remove('cache')
|
||||
this.unlike(item)
|
||||
} else {
|
||||
item.save = true
|
||||
event.target.textContent = '移除'
|
||||
this.ul.querySelector(`#${item.id}`).classList.add('cache')
|
||||
this.like(item)
|
||||
@ -170,7 +172,6 @@ export default class MusicList {
|
||||
this.event.onlike(item, this.list)
|
||||
}
|
||||
async unlike(item) {
|
||||
this.remove(item)
|
||||
this.event.onunlike(item, this.list)
|
||||
}
|
||||
async ban(item) {
|
||||
|
Loading…
Reference in New Issue
Block a user