Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
UnblockNeteaseMusic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror From Github
UnblockNeteaseMusic
Commits
92f58dee
Commit
92f58dee
authored
3 years ago
by
Silvan
Browse files
Options
Downloads
Patches
Plain Diff
fix #44
parent
4d229942
No related branches found
Branches containing commit
Tags
0.2.9
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
build.sh
+1
-1
1 addition, 1 deletion
build.sh
config/config.go
+5
-4
5 additions, 4 deletions
config/config.go
provider/provider.go
+5
-12
5 additions, 12 deletions
provider/provider.go
with
11 additions
and
17 deletions
build.sh
+
1
−
1
View file @
92f58dee
CurrentVersion
=
0.2.
8
CurrentVersion
=
0.2.
9
Project
=
github.com/cnsilvan/UnblockNeteaseMusic
Path
=
"
$Project
/version"
ExecName
=
"UnblockNeteaseMusic"
...
...
This diff is collapsed.
Click to expand it.
config/config.go
+
5
−
4
View file @
92f58dee
...
...
@@ -3,14 +3,15 @@ package config
import
(
"flag"
"fmt"
"github.com/cnsilvan/UnblockNeteaseMusic/common"
"github.com/cnsilvan/UnblockNeteaseMusic/utils"
"github.com/cnsilvan/UnblockNeteaseMusic/version"
"io"
"log"
"os"
"path/filepath"
"strings"
"github.com/cnsilvan/UnblockNeteaseMusic/common"
"github.com/cnsilvan/UnblockNeteaseMusic/utils"
"github.com/cnsilvan/UnblockNeteaseMusic/version"
)
var
(
...
...
@@ -22,7 +23,7 @@ var (
LogFile
=
flag
.
String
(
"l"
,
""
,
"specify log file ,such as :
\"
/var/log/unblockNeteaseMusic.log
\"
"
)
Mode
=
flag
.
Int
(
"m"
,
1
,
"specify running mode(1:hosts) ,such as :
\"
1
\"
"
)
V
=
flag
.
Bool
(
"v"
,
false
,
"display version info"
)
EndPoint
=
flag
.
Bool
(
"e"
,
false
,
"replace song url"
)
EndPoint
=
flag
.
Bool
(
"e"
,
false
,
"
enable
replace song url"
)
ForceBestQuality
=
flag
.
Bool
(
"b"
,
false
,
"force the best music quality"
)
SearchLimit
=
flag
.
Int
(
"sl"
,
0
,
"specify the number of songs searched on other platforms(the range is 0 to 3) ,such as :
\"
1
\"
"
)
)
...
...
This diff is collapsed.
Click to expand it.
provider/provider.go
+
5
−
12
View file @
92f58dee
...
...
@@ -194,16 +194,7 @@ func parseSongFn(key common.MapType, music common.SearchMusic) *common.Song {
result
:=
&
common
.
Song
{}
result
.
Size
=
0
for
_
,
song
:=
range
songs
{
//songNameKeys := utils.ParseSongNameKeyWord(song.Name)
//log.Println("songNameKeys:", strings.Join(songNameKeys, "、"))
//songNameSores := utils.CalMatchScores(searchSongName, songNameKeys)
//log.Println("songNameSores:", songNameSores)
//artistKeys := utils.ParseSingerKeyWord(song.Artist)
//log.Println("artistKeys:", strings.Join(artistKeys, "、"))
//artistsNameSores := utils.CalMatchScores(searchArtistsName, artistKeys)
//log.Println("artistsNameSores:", artistsNameSores)
//songMatchScore := songNameSores*0.6 + artistsNameSores*0.4
//song.MatchScore = songMatchScore
if
song
.
MatchScore
>
result
.
MatchScore
{
result
=
song
}
else
if
song
.
MatchScore
==
result
.
MatchScore
&&
song
.
Size
>
result
.
Size
{
...
...
@@ -226,8 +217,9 @@ func getSongFromAllSource(key common.SearchSong, ch chan *common.Song) []*common
var
songs
[]
*
common
.
Song
sum
:=
0
for
_
,
p
:=
range
providers
{
pt
:=
p
go
utils
.
PanicWrapper
(
func
()
{
ch
<-
calculateSongInfo
(
p
.
ParseSong
(
key
))
ch
<-
calculateSongInfo
(
p
t
.
ParseSong
(
key
))
})
sum
++
}
...
...
@@ -252,8 +244,9 @@ func SearchSongFromAllSource(key common.SearchSong) []*common.Song {
ch
:=
make
(
chan
[]
*
common
.
Song
)
sum
:=
0
for
_
,
p
:=
range
providers
{
pt
:=
p
go
utils
.
PanicWrapper
(
func
()
{
ch
<-
p
.
SearchSong
(
key
)
ch
<-
p
t
.
SearchSong
(
key
)
})
sum
++
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment