mirror of
https://github.com/nxshock/promodj.git
synced 2024-11-27 03:01:01 +05:00
Resolve linter issues
This commit is contained in:
parent
fc684125cc
commit
87bc382747
@ -86,7 +86,7 @@ func handleGetM3u(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Header().Set("Content-Type", "audio/x-mpegurl")
|
w.Header().Set("Content-Type", "audio/x-mpegurl")
|
||||||
w.Header().Set("Accept-Ranges", "none")
|
w.Header().Set("Accept-Ranges", "none")
|
||||||
|
|
||||||
w.Write(b)
|
_, _ = w.Write(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleStream(w http.ResponseWriter, r *http.Request) {
|
func handleStream(w http.ResponseWriter, r *http.Request) {
|
||||||
|
17
parser.go
17
parser.go
@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -40,7 +41,13 @@ func UpdateGenres() error {
|
|||||||
func updateGenreList() ([]Genre, error) {
|
func updateGenreList() ([]Genre, error) {
|
||||||
url := "https://promodj.com/music"
|
url := "https://promodj.com/music"
|
||||||
|
|
||||||
doc, err := goquery.NewDocument(url)
|
resp, err := http.Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
doc, err := goquery.NewDocumentFromReader(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -54,7 +61,13 @@ func updateGenreList() ([]Genre, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parsePage(url string, resultsChan chan TrackInfo) {
|
func parsePage(url string, resultsChan chan TrackInfo) {
|
||||||
doc, err := goquery.NewDocument(url)
|
resp, err := http.Get(url)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
doc, err := goquery.NewDocumentFromReader(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ func encode(url string, w io.Writer) error {
|
|||||||
buf := buffer.New(int64(config.BufferSize) * 1024 * 1024)
|
buf := buffer.New(int64(config.BufferSize) * 1024 * 1024)
|
||||||
_, err = nio.Copy(w, out, buf)
|
_, err = nio.Copy(w, out, buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cmd.Process.Kill()
|
_ = cmd.Process.Kill()
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user