mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-06 18:32:50 +08:00
fix bug: when diange limit is 1, user can only diange once & update version number to 1.2.0
This commit is contained in:
@@ -135,6 +135,7 @@ func (d *Diange) Enable() error {
|
||||
"plugin.diange.queue.update",
|
||||
func(event *event.Event) {
|
||||
d.currentQueueLength = len(event.Data.(events.PlaylistDetailUpdateEvent).Medias)
|
||||
d.log.Debugf("current queue length: %d", d.currentQueueLength)
|
||||
medias := event.Data.(events.PlaylistDetailUpdateEvent).Medias
|
||||
tmpUserCount := make(map[string]int)
|
||||
for _, media := range medias {
|
||||
@@ -144,8 +145,11 @@ func (d *Diange) Enable() error {
|
||||
}
|
||||
tmpUserCount[media.ToUser().Name]++
|
||||
}
|
||||
// clear user count
|
||||
d.userCount.Clear()
|
||||
for user, count := range tmpUserCount {
|
||||
d.userCount.Store(user, count)
|
||||
d.log.Debugf("user media count in player playlist %s: %d", user, count)
|
||||
}
|
||||
})
|
||||
global.EventManager.RegisterA(
|
||||
|
||||
Reference in New Issue
Block a user