mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-11 20:58:13 +08:00
fix id diange not working
This commit is contained in:
Submodule pkg/miaosic updated: a743c5f97c...95343bb3f9
@@ -213,6 +213,13 @@ func (d *Diange) handleMessage(event *event.Event) {
|
|||||||
|
|
||||||
d.cooldowns[message.User.Uid] = ct
|
d.cooldowns[message.User.Uid] = ct
|
||||||
|
|
||||||
|
// match media first
|
||||||
|
|
||||||
|
mediaMeta, found := miaosic.MatchMedia(keywords)
|
||||||
|
|
||||||
|
var media miaosic.MediaInfo
|
||||||
|
|
||||||
|
if !found {
|
||||||
for _, source := range sources {
|
for _, source := range sources {
|
||||||
medias, err := miaosic.SearchByProvider(source, keywords, 1, 10)
|
medias, err := miaosic.SearchByProvider(source, keywords, 1, 10)
|
||||||
if len(medias) == 0 || err != nil {
|
if len(medias) == 0 || err != nil {
|
||||||
@@ -229,12 +236,26 @@ func (d *Diange) handleMessage(event *event.Event) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
media = medias[0]
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
m, err := miaosic.GetMediaInfo(mediaMeta)
|
||||||
|
if err != nil {
|
||||||
|
d.log.Error("Get media info failed: ", err)
|
||||||
|
found = false
|
||||||
|
}
|
||||||
|
media = m
|
||||||
|
}
|
||||||
|
|
||||||
|
if found {
|
||||||
if d.SkipSystemPlaylist && d.isCurrentSystem {
|
if d.SkipSystemPlaylist && d.isCurrentSystem {
|
||||||
global.EventManager.CallA(
|
global.EventManager.CallA(
|
||||||
events.PlayerPlayCmd,
|
events.PlayerPlayCmd,
|
||||||
events.PlayerPlayCmdEvent{
|
events.PlayerPlayCmdEvent{
|
||||||
Media: model.Media{
|
Media: model.Media{
|
||||||
Info: medias[0],
|
Info: media,
|
||||||
User: message.User,
|
User: message.User,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -245,12 +266,13 @@ func (d *Diange) handleMessage(event *event.Event) {
|
|||||||
events.PlaylistInsertCmdEvent{
|
events.PlaylistInsertCmdEvent{
|
||||||
Position: -1,
|
Position: -1,
|
||||||
Media: model.Media{
|
Media: model.Media{
|
||||||
Info: medias[0],
|
Info: media,
|
||||||
User: message.User,
|
User: message.User,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Diange) Title() string {
|
func (d *Diange) Title() string {
|
||||||
|
|||||||
Reference in New Issue
Block a user