Skip to content

Commit cfa228d

Browse files
authored
Use a separate key for the spotify cache (#2830)
1 parent 907637d commit cfa228d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

consul_config.py.ctmpl

+4
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ SPOTIFY_CLIENT_ID = '''{{template "KEY" "spotify/client_id"}}'''
240240
SPOTIFY_CLIENT_SECRET = '''{{template "KEY" "spotify/client_secret"}}'''
241241
SPOTIFY_CALLBACK_URL = '''{{template "KEY" "spotify/redirect_uri"}}'''
242242

243+
# SPOTIFY METADATA CACHE
244+
SPOTIFY_CACHE_CLIENT_ID = '''{{template "KEY" "spotify_cache/client_id"}}'''
245+
SPOTIFY_CACHE_CLIENT_SECRET = '''{{template "KEY" "spotify_cache/client_secret"}}'''
246+
243247
# APPLE MUSIC
244248
APPLE_MUSIC_TEAM_ID = '''{{template "KEY" "apple/team_id"}}'''
245249
APPLE_MUSIC_KID = '''{{template "KEY" "apple/kid"}}'''

listenbrainz/config.py.sample

+4
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ SPOTIFY_CLIENT_ID = 'needs a non empty default value for tests, change this'
159159
SPOTIFY_CLIENT_SECRET = 'needs a non empty default value for tests, change this'
160160
SPOTIFY_CALLBACK_URL = 'http://localhost:8100/settings/music-services/spotify/callback/'
161161

162+
# SPOTIFY-CACHE
163+
SPOTIFY_CACHE_CLIENT_ID = 'needs a non empty default value for tests, change this'
164+
SPOTIFY_CACHE_CLIENT_SECRET = 'needs a non empty default value for tests, change this'
165+
162166
# SOUNDCLOUD
163167
SOUNDCLOUD_CLIENT_ID = 'needs a non empty default value for tests, change this'
164168
SOUNDCLOUD_CLIENT_SECRET = 'needs a non empty default value for tests, change this'

listenbrainz/metadata_cache/spotify/handler.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def __init__(self, app):
3434
respect_retry_after_header=False
3535
)
3636
self.sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(
37-
client_id=app.config["SPOTIFY_CLIENT_ID"],
38-
client_secret=app.config["SPOTIFY_CLIENT_SECRET"]
37+
client_id=app.config["SPOTIFY_CACHE_CLIENT_ID"],
38+
client_secret=app.config["SPOTIFY_CACHE_CLIENT_SECRET"]
3939
))
4040

4141
def get_items_from_listen(self, listen) -> list[JobItem]:

0 commit comments

Comments
 (0)