mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-12-25 16:19:00 +00:00
Tidy up logging
This commit is contained in:
parent
91e1e83466
commit
c267f5a7ef
@ -28,6 +28,7 @@ func insertAlbum(name string, mbid string, artists []string, tx *sql.Tx) (Album,
|
||||
}
|
||||
|
||||
album = fetchAlbum("mbid", mbid, tx)
|
||||
album.linkAlbumToArtists(artists, tx)
|
||||
}
|
||||
} else {
|
||||
album = fetchAlbum("name", name, tx)
|
||||
@ -39,6 +40,7 @@ func insertAlbum(name string, mbid string, artists []string, tx *sql.Tx) (Album,
|
||||
}
|
||||
|
||||
album = fetchAlbum("name", name, tx)
|
||||
album.linkAlbumToArtists(artists, tx)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,8 +10,6 @@ import (
|
||||
|
||||
// ParseJellyfinInput - Transform API data into a common struct
|
||||
func ParseJellyfinInput(userUUID string, data map[string]interface{}, ip net.IP, tx *sql.Tx) error {
|
||||
log.Printf("%+v : %+v", userUUID, data)
|
||||
|
||||
// Insert artist if not exist
|
||||
artist, err := insertArtist(fmt.Sprintf("%s", data["Artist"]), fmt.Sprintf("%s", data["Provider_musicbrainzartist"]), tx)
|
||||
if err != nil {
|
||||
|
@ -223,7 +223,7 @@ func handleIngress(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
ingressType := strings.Replace(r.URL.Path, "/api/v1/ingress/", "", 1)
|
||||
log.Println(ingressType)
|
||||
|
||||
switch ingressType {
|
||||
case "jellyfin":
|
||||
tx, _ := db.Begin()
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"log"
|
||||
"math/big"
|
||||
"net"
|
||||
"net/http"
|
||||
@ -40,7 +39,7 @@ func contains(s []string, e string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// getUserIp - Returns IP that isn't set in REVERSE_PROXY
|
||||
// getUserIp - Returns IP that isn't set in REVERSE_PROXIES
|
||||
func getUserIp(r *http.Request) net.IP {
|
||||
var ip net.IP
|
||||
host, _, _ := net.SplitHostPort(r.RemoteAddr)
|
||||
@ -57,7 +56,6 @@ func getUserIp(r *http.Request) net.IP {
|
||||
}
|
||||
|
||||
ip = net.ParseIP(host)
|
||||
log.Printf("%+v", ip)
|
||||
return ip
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user