Compare commits

..

10 Commits

Author SHA1 Message Date
187d8e92f0 release: version 0.6.10 🚀
Some checks failed
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 4m17s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
SonarQube Scan / SonarQube Trigger (push) Failing after 6m10s
Build Docker image / Create Release (push) Successful in 40s
Build Docker image / deploy (push) Successful in 12m58s
2025-07-26 16:32:43 +02:00
07c7af4633 fix: proper Spotify token refresh flow, refs: NOISSUE 2025-07-26 16:32:41 +02:00
e38023d790 release: version 0.6.9 🚀
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
Build Docker image / Create Release (push) Successful in 44s
Build Docker image / deploy (push) Successful in 1m59s
2025-07-20 17:45:00 +02:00
939ae74e95 fix: improved Spotify auth check flow, refs NOISSUE 2025-07-20 17:44:52 +02:00
95406be062 release: version 0.6.8 🚀
Some checks failed
Build Docker image / Create Release (push) Successful in 22s
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m17s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
Build Docker image / deploy (push) Successful in 1m59s
SonarQube Scan / SonarQube Trigger (push) Failing after 4m54s
2025-07-20 17:32:20 +02:00
918ed2e667 fix: improved Spotify auth check flow, refs NOISSUE 2025-07-20 17:32:18 +02:00
e0b0d6b98c release: version 0.6.7 🚀
Some checks failed
Build Docker image / Create Release (push) Successful in 20s
CI / linter (9.0.X, ubuntu-latest) (push) Failing after 1m23s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been skipped
Build Docker image / deploy (push) Successful in 2m29s
SonarQube Scan / SonarQube Trigger (push) Failing after 4m53s
2025-07-20 17:24:16 +02:00
74a8c7dbe8 fix: attempted bugfix for crashing process on invalid spotify access token, refs NOISSUE 2025-07-20 17:24:14 +02:00
da2a32ecfc release: version 0.6.6 🚀
Some checks failed
Build Docker image / Create Release (push) Successful in 16s
CI / tests_linux (9.0.X, ubuntu-latest) (push) Has been cancelled
CI / linter (9.0.X, ubuntu-latest) (push) Has been cancelled
SonarQube Scan / SonarQube Trigger (push) Has been cancelled
Build Docker image / deploy (push) Successful in 1m33s
2025-07-20 17:14:53 +02:00
ef8c8fb867 fix: add additional logging, refs NOISSUE 2025-07-20 17:14:49 +02:00
4 changed files with 77 additions and 13 deletions

View File

@@ -5,10 +5,66 @@ Changelog
(unreleased) (unreleased)
------------ ------------
Fix
~~~
- Proper Spotify token refresh flow, refs: NOISSUE. [Simon Diesenreiter]
0.6.9 (2025-07-20)
------------------
Fix
~~~
- Improved Spotify auth check flow, refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.6.8 (2025-07-20)
------------------
Fix
~~~
- Improved Spotify auth check flow, refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.6.7 (2025-07-20)
------------------
Fix
~~~
- Attempted bugfix for crashing process on invalid spotify access token,
refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.6.6 (2025-07-20)
------------------
Fix
~~~
- Add additional logging, refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.6.5 (2025-07-20)
------------------
Fix Fix
~~~ ~~~
- Configurable Cron schedules, refs NOISSUE. [Simon Diesenreiter] - Configurable Cron schedules, refs NOISSUE. [Simon Diesenreiter]
Other
~~~~~
0.6.4 (2025-07-20) 0.6.4 (2025-07-20)
------------------ ------------------

View File

@@ -86,19 +86,24 @@ likePlaylistCheckTimer.OnOccurence += async (s, ea) =>
{ {
if (!await spotifyApiClient.IsUserAuthenticatedAsync(user)) if (!await spotifyApiClient.IsUserAuthenticatedAsync(user))
{ {
continue; logger.LogWarning($"User {user.LdapUserName} is not authorized with Spotify - skipping playlist sync");
} }
var foundPlaylist = dci.SmartPlaylistDefinitions?.Where(p => p.CreatedBy == user).ToList().Where(p => p.IsThisUsersLikedSongsPlaylist).SingleOrDefault(); else
if (foundPlaylist == null)
{ {
var title = $"{user.PreferredName}'s liked Songs"; var foundPlaylist = dci.SmartPlaylistDefinitions?.Where(p => p.CreatedBy == user).ToList().Where(p => p.IsThisUsersLikedSongsPlaylist).SingleOrDefault();
var description = $"A collection of the songs liked by {user.PreferredName} on their 'Song of the day' server instance."; if (foundPlaylist == null)
// playlist does not exist yet, creating it {
var newPlaylist = await (await spotifyApiClient.WithUserAuthorizationAsync(user)).CreateSpotifyPlaylist(title, description, false, true, user); logger.LogWarning($"Creating liked songs playlist for user {user.LdapUserName}");
await playlistSynchronizer.SynchronizePlaylistAsync(newPlaylist); var title = $"{user.PreferredName}'s liked songs";
needsSaving = true; var description = $"A collection of the songs liked by {user.PreferredName} on their 'Song of the day' server instance.";
// playlist does not exist yet, creating it
var newPlaylist = await (await spotifyApiClient.WithUserAuthorizationAsync(user)).CreateSpotifyPlaylist(title, description, false, true, user);
await playlistSynchronizer.SynchronizePlaylistAsync(newPlaylist);
needsSaving = true;
}
logger.LogWarning($"Syncing playlists for user {user.LdapUserName}");
await playlistSynchronizer.SynchronizeUserPlaylistsAsync(user);
} }
await playlistSynchronizer.SynchronizeUserPlaylistsAsync(user);
} }
if (needsSaving) if (needsSaving)

View File

@@ -110,7 +110,7 @@ public class SpotifyApiClient
public async Task<string> GetValidAuthorizationTokenAsync(User user) public async Task<string> 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 // user either never connected Spotify or we failed to refresh token - user needs to re-authenticate
return string.Empty; return string.Empty;
@@ -139,7 +139,10 @@ public class SpotifyApiClient
user.SpotifyAuthAccessToken = oAuthResponse.AccessToken; user.SpotifyAuthAccessToken = oAuthResponse.AccessToken;
user.SpotifyAuthExpiresAfterSeconds = oAuthResponse.ExpiresIn; user.SpotifyAuthExpiresAfterSeconds = oAuthResponse.ExpiresIn;
user.SpotifyAuthCreatedAt = oAuthResponse.CreatedAt; user.SpotifyAuthCreatedAt = oAuthResponse.CreatedAt;
user.SpotifyAuthRefreshToken = oAuthResponse.RefreshToken; if (!string.IsNullOrEmpty(oAuthResponse.RefreshToken))
{
user.SpotifyAuthRefreshToken = oAuthResponse.RefreshToken;
}
return user.SpotifyAuthAccessToken; return user.SpotifyAuthAccessToken;
} }
catch (Exception ex) catch (Exception ex)

View File

@@ -1 +1 @@
0.6.5 0.6.10