optimized the rules;

This commit is contained in:
Silvan 2021-06-08 11:03:15 +08:00
parent d8a24e8ee2
commit 6d8d10f179
3 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,4 @@
CurrentVersion=0.2.10
CurrentVersion=0.2.11
Project=github.com/cnsilvan/UnblockNeteaseMusic
Path="$Project/version"
ExecName="UnblockNeteaseMusic"

View File

@ -46,6 +46,14 @@ func CalScore(song common.SearchSong, songName string, singerName string, index
if strings.Contains(songName, "伴奏") && !strings.Contains(song.Keyword, "伴奏") {
return 0, false
}
if strings.Contains(strings.ToUpper(songName), "DJ") &&
!strings.Contains(strings.ToUpper(song.Keyword), "DJ") {
return 0, false
}
if strings.Contains(strings.ToUpper(songName), "cover") &&
!strings.Contains(strings.ToUpper(song.Keyword), "cover") {
return 0, false
}
var songNameSores float32 = 0.0
if len(songName) > 0 {
songNameSores = utils.CalMatchScoresV2(song.Name, songName, "songName")

View File

@ -40,7 +40,7 @@ func (m *KuWo) SearchSong(song common.SearchSong) (songs []*common.Song) {
maxIndex = 10
}
for index, matched := range list {
if index >= maxIndex {
if index >= 1 {//kuwo list order by score default
break
}
kuWoSong, ok := matched.(common.MapType)