ui界面优化,event handler优化-新增任务池模式,歌词加载优化,新房间管理(可以自动连接) 本地音频搜索算法优化,

This commit is contained in:
Aynakeya
2022-12-31 21:22:35 -08:00
parent 1e18ca1ff2
commit 9d99a74faf
12 changed files with 117 additions and 41 deletions

View File

@@ -241,7 +241,7 @@ func (p *corePlaylist) Get(index int) *model.Media {
}
func (p *corePlaylist) Pop() *model.Media {
lg.Info("[Playlists] %s pop first media", p.Playlist)
lg.Debugf("[Playlists] %s pop first media", p.Playlist)
if p.Size() == 0 {
return nil
}
@@ -262,7 +262,9 @@ func (p *corePlaylist) Pop() *model.Media {
}
p.eventManager.CallA(
model.EventPlaylistUpdate,
model.PlaylistUpdateEvent{Playlist: p.Playlist.Copy()},
model.PlaylistUpdateEvent{
Playlist: p.Playlist.Copy(),
},
)
return m
}
@@ -275,7 +277,9 @@ func (p *corePlaylist) Replace(medias []*model.Media) {
p.Lock.Unlock()
p.eventManager.CallA(
model.EventPlaylistUpdate,
model.PlaylistUpdateEvent{Playlist: p.Playlist.Copy()},
model.PlaylistUpdateEvent{
Playlist: p.Playlist.Copy(),
},
)
}
@@ -315,7 +319,9 @@ func (p *corePlaylist) Insert(index int, media *model.Media) {
p.Lock.Unlock()
p.eventManager.CallA(
model.EventPlaylistUpdate,
model.PlaylistUpdateEvent{Playlist: p.Playlist.Copy()},
model.PlaylistUpdateEvent{
Playlist: p.Playlist.Copy(),
},
)
p.eventManager.CallA(
model.EventPlaylistInsert,
@@ -343,7 +349,9 @@ func (p *corePlaylist) Delete(index int) *model.Media {
}
p.eventManager.CallA(
model.EventPlaylistUpdate,
model.PlaylistUpdateEvent{Playlist: p.Playlist.Copy()})
model.PlaylistUpdateEvent{
Playlist: p.Playlist.Copy(),
})
return m
}
@@ -376,7 +384,9 @@ func (p *corePlaylist) Move(src int, dst int) {
p.Lock.Unlock()
p.eventManager.CallA(
model.EventPlaylistUpdate,
model.PlaylistUpdateEvent{Playlist: p.Playlist.Copy()})
model.PlaylistUpdateEvent{
Playlist: p.Playlist.Copy(),
})
}
func (p *corePlaylist) Next() *model.Media {