Update Spotify access token

Fixes #1769
This commit is contained in:
Jonas Kvinge
2025-07-29 23:44:36 +02:00
parent 96a53bfbe5
commit 7844a2b932
7 changed files with 56 additions and 2 deletions

View File

@@ -517,10 +517,20 @@ bool GstEngine::ExclusiveModeSupport(const QString &output) const {
void GstEngine::ReloadSettings() {
#ifdef HAVE_SPOTIFY
const QString old_spotify_access_token = spotify_access_token_;
#endif
EngineBase::ReloadSettings();
if (output_.isEmpty()) output_ = QLatin1String(kAutoSink);
#ifdef HAVE_SPOTIFY
if (current_pipeline_ && old_spotify_access_token != spotify_access_token_) {
current_pipeline_->set_spotify_access_token(spotify_access_token_);
}
#endif
}
void GstEngine::ConsumeBuffer(GstBuffer *buffer, const int pipeline_id, const QString &format) {
@@ -1199,3 +1209,13 @@ bool GstEngine::AnyExclusivePipelineActive() const {
return (current_pipeline_ && current_pipeline_->exclusive_mode()) || OldExclusivePipelineActive();
}
#ifdef HAVE_SPOTIFY
void GstEngine::SetSpotifyAccessToken() {
if (current_pipeline_) {
current_pipeline_->set_spotify_access_token(spotify_access_token_);
}
}
#endif // HAVE_SPOTIFY