mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-21 16:11:56 +00:00
Fix up spotify API
This commit is contained in:
parent
97a6087e42
commit
3f033170e0
@ -17,7 +17,7 @@ import (
|
|||||||
// updateSpotifyData - Pull data for all users
|
// updateSpotifyData - Pull data for all users
|
||||||
func updateSpotifyData() {
|
func updateSpotifyData() {
|
||||||
// Lets ignore if not configured
|
// Lets ignore if not configured
|
||||||
val, _ := getConfigValue("SPOTIFY_APP_SECRET")
|
val, _ := getConfigValue("SPOTIFY_API_SECRET")
|
||||||
if val == "" {
|
if val == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -35,8 +35,8 @@ func updateSpotifyData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getSpotifyAuthHandler() spotify.Authenticator {
|
func getSpotifyAuthHandler() spotify.Authenticator {
|
||||||
appId, _ := getConfigValue("SPOTIFY_APP_ID")
|
appId, _ := getConfigValue("SPOTIFY_API_ID")
|
||||||
appSecret, _ := getConfigValue("SPOTIFY_APP_SECRET")
|
appSecret, _ := getConfigValue("SPOTIFY_API_SECRET")
|
||||||
|
|
||||||
redirectUrl := os.Getenv("GOSCROBBLE_DOMAIN") + "/api/v1/link/spotify"
|
redirectUrl := os.Getenv("GOSCROBBLE_DOMAIN") + "/api/v1/link/spotify"
|
||||||
if redirectUrl == "http://localhost:3000/api/v1/link/spotify" {
|
if redirectUrl == "http://localhost:3000/api/v1/link/spotify" {
|
||||||
@ -217,7 +217,7 @@ func ParseSpotifyInput(userUUID string, data spotify.RecentlyPlayedItem, client
|
|||||||
// updateImageDataFromSpotify update artist/album images from spotify ;D
|
// updateImageDataFromSpotify update artist/album images from spotify ;D
|
||||||
func (user *User) updateImageDataFromSpotify() error {
|
func (user *User) updateImageDataFromSpotify() error {
|
||||||
// Check that data is set before we attempt to pull
|
// Check that data is set before we attempt to pull
|
||||||
val, _ := getConfigValue("SPOTIFY_APP_SECRET")
|
val, _ := getConfigValue("SPOTIFY_API_SECRET")
|
||||||
if val == "" {
|
if val == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -702,7 +702,7 @@ func postSpotifyReponse(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// getSpotifyClientID - Returns public spotify APP ID
|
// getSpotifyClientID - Returns public spotify APP ID
|
||||||
func getSpotifyClientID(w http.ResponseWriter, r *http.Request, claims CustomClaims, v string) {
|
func getSpotifyClientID(w http.ResponseWriter, r *http.Request, claims CustomClaims, v string) {
|
||||||
key, err := getConfigValue("SPOTIFY_APP_ID")
|
key, err := getConfigValue("SPOTIFY_API_ID")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
throwOkError(w, "Failed to get Spotify ID")
|
throwOkError(w, "Failed to get Spotify ID")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user