From 74a8c7dbe883a7bef078147c9d0db0f2f3f10c2b Mon Sep 17 00:00:00 2001 From: Simon Diesenreiter Date: Sun, 20 Jul 2025 17:24:14 +0200 Subject: [PATCH] fix: attempted bugfix for crashing process on invalid spotify access token, refs NOISSUE --- song_of_the_day/Program.cs | 2 +- song_of_the_day/SpotifyIntegration/SpotifyApiClient.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/song_of_the_day/Program.cs b/song_of_the_day/Program.cs index 6e30bc4..1550940 100644 --- a/song_of_the_day/Program.cs +++ b/song_of_the_day/Program.cs @@ -255,6 +255,7 @@ messageSyncTimer.OnOccurence += async (s, ea) => // only start interaction timers in production builds // for local/development testing we want those disabled + likePlaylistCheckTimer.Start(); if (!app.Environment.IsDevelopment()) { logger.LogTrace("Starting timer for scheduled processes."); @@ -262,7 +263,6 @@ if (!app.Environment.IsDevelopment()) userIntroTimer.Start(); pickOfTheDayTimer.Start(); ldapAssociationTimer.Start(); - likePlaylistCheckTimer.Start(); } else { diff --git a/song_of_the_day/SpotifyIntegration/SpotifyApiClient.cs b/song_of_the_day/SpotifyIntegration/SpotifyApiClient.cs index 54157d0..8c06e06 100644 --- a/song_of_the_day/SpotifyIntegration/SpotifyApiClient.cs +++ b/song_of_the_day/SpotifyIntegration/SpotifyApiClient.cs @@ -110,7 +110,7 @@ public class SpotifyApiClient public async Task GetValidAuthorizationTokenAsync(User user) { - if (string.IsNullOrEmpty(user.SpotifyAuthAccessToken)) + if (string.IsNullOrEmpty(user.SpotifyAuthAccessToken) || string.IsNullOrEmpty(user.SpotifyAuthRefreshToken)) { // user either never connected Spotify or we failed to refresh token - user needs to re-authenticate return string.Empty;