示例#1
0
// Create index used by search
func (ms *MusicServer) index(response http.ResponseWriter, request *http.Request) {
	// Always check addressMask. If no define, mask is 0.0.0.0 and nothing is accepted (except localhost)
	if !ms.checkRequester(request) {
		return
	}
	if ms.musicFolder != "" {
		ms.textIndexer = music.IndexArtists(ms.folder)
	}
}
示例#2
0
func main() {
	args := arguments.ParseArgs()

	switch args["task"] {
	case "browse":
		dico := music.LoadDictionnary(args["workingFolder"])
		dico.Browse(args["browse"])
	case "index":
		music.IndexArtists(args["workingFolder"])
	default:
		fmt.Println("No task define. Available tasks (-task) : browse (-workingFolder and -browse required), index (-workingFolder required)")
	}

}