mirror of
https://github.com/gabehf/music-importer.git
synced 2026-04-22 11:31:52 -07:00
mbz discover + auto import
This commit is contained in:
parent
986b0273be
commit
c7d6a088ed
11 changed files with 2036 additions and 266 deletions
10
main.go
10
main.go
|
|
@ -18,6 +18,9 @@ var importerRunning bool
|
|||
|
||||
//go:embed index.html.tmpl
|
||||
var tmplFS embed.FS
|
||||
|
||||
//go:embed static
|
||||
var staticFS embed.FS
|
||||
var tmpl = template.Must(
|
||||
template.New("index.html.tmpl").
|
||||
Funcs(template.FuncMap{
|
||||
|
|
@ -120,8 +123,15 @@ func handleRun(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
func main() {
|
||||
log.Printf("Music Importer %s starting on http://localhost:8080", version)
|
||||
startMonitor()
|
||||
http.Handle("/static/", http.FileServer(http.FS(staticFS)))
|
||||
http.HandleFunc("/", handleHome)
|
||||
http.HandleFunc("/run", handleRun)
|
||||
http.HandleFunc("/discover/search", handleDiscoverSearch)
|
||||
http.HandleFunc("/discover/fetch", handleDiscoverFetch)
|
||||
http.HandleFunc("/discover/fetch/artist", handleDiscoverFetchArtist)
|
||||
http.HandleFunc("/discover/fetch/status", handleDiscoverFetchStatus)
|
||||
http.HandleFunc("/discover/fetch/list", handleDiscoverFetchList)
|
||||
|
||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue