Added SPOTIFY_COUNTRY_CODE env var, defaults to 'DE'

- before it was hard coded to DE
This commit is contained in:
Kamil
2024-11-27 16:07:08 +00:00
parent dc0165957a
commit c9363104ec
2 changed files with 3 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ from .version import __version__
def add_context(): def add_context():
unlinked_track_count = len(Track.query.filter_by(downloaded=True,jellyfin_id=None).all()) unlinked_track_count = len(Track.query.filter_by(downloaded=True,jellyfin_id=None).all())
version = f"v{__version__}{read_dev_build_file()}" 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 # this feels wrong
@@ -135,7 +135,7 @@ def logout():
@app.route('/playlists/monitored') @app.route('/playlists/monitored')
@functions.jellyfin_login_required @functions.jellyfin_login_required
def loaditems(): 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) offset = int(request.args.get('offset', 0)) # Get the offset (default to 0 for initial load)
limit = 20 # Define a limit for pagination limit = 20 # Define a limit for pagination
additional_query = '' additional_query = ''

View File

@@ -26,6 +26,7 @@ class Config:
REDIS_URL = os.getenv('REDIS_URL','redis://redis:6379/0') REDIS_URL = os.getenv('REDIS_URL','redis://redis:6379/0')
SEARCH_JELLYFIN_BEFORE_DOWNLOAD = os.getenv('SEARCH_JELLYFIN_BEFORE_DOWNLOAD',"true").lower() == 'true' 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' 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 specific configuration
SPOTDL_CONFIG = { SPOTDL_CONFIG = {
'cookie_file': '/jellyplist/cookies.txt', 'cookie_file': '/jellyplist/cookies.txt',