diff --git a/app/routes.py b/app/routes.py index c3a2774..63c1ad1 100644 --- a/app/routes.py +++ b/app/routes.py @@ -8,7 +8,7 @@ from .version import __version__ def add_context(): unlinked_track_count = len(Track.query.filter_by(downloaded=True,jellyfin_id=None).all()) version = f"v{__version__}{read_dev_build_file()}" - return dict(unlinked_track_count = unlinked_track_count, version = version) + return dict(unlinked_track_count = unlinked_track_count, version = version, config = app.config) # this feels wrong @@ -135,7 +135,7 @@ def logout(): @app.route('/playlists/monitored') @functions.jellyfin_login_required def loaditems(): - country = 'DE' + country = app.config['SPOTIFY_COUNTRY_CODE'] offset = int(request.args.get('offset', 0)) # Get the offset (default to 0 for initial load) limit = 20 # Define a limit for pagination additional_query = '' diff --git a/config.py b/config.py index 3fc6dae..ca151e2 100644 --- a/config.py +++ b/config.py @@ -26,6 +26,7 @@ class Config: REDIS_URL = os.getenv('REDIS_URL','redis://redis:6379/0') SEARCH_JELLYFIN_BEFORE_DOWNLOAD = os.getenv('SEARCH_JELLYFIN_BEFORE_DOWNLOAD',"true").lower() == 'true' FIND_BEST_MATCH_USE_FFPROBE = os.getenv('FIND_BEST_MATCH_USE_FFPROBE','false').lower() == 'true' + SPOTIFY_COUNTRY_CODE = os.getenv('SPOTIFY_COUNTRY_CODE','DE') # SpotDL specific configuration SPOTDL_CONFIG = { 'cookie_file': '/jellyplist/cookies.txt',