Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
e38023d790 | |||
939ae74e95 | |||
95406be062 | |||
918ed2e667 | |||
e0b0d6b98c | |||
74a8c7dbe8 |
34
HISTORY.md
34
HISTORY.md
@ -5,10 +5,44 @@ Changelog
|
|||||||
(unreleased)
|
(unreleased)
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
Fix
|
||||||
|
~~~
|
||||||
|
- Improved Spotify auth check flow, refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
|
||||||
|
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
|
Fix
|
||||||
~~~
|
~~~
|
||||||
- Add additional logging, refs NOISSUE. [Simon Diesenreiter]
|
- Add additional logging, refs NOISSUE. [Simon Diesenreiter]
|
||||||
|
|
||||||
|
Other
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
0.6.5 (2025-07-20)
|
0.6.5 (2025-07-20)
|
||||||
------------------
|
------------------
|
||||||
|
@ -87,21 +87,23 @@ likePlaylistCheckTimer.OnOccurence += async (s, ea) =>
|
|||||||
if (!await spotifyApiClient.IsUserAuthenticatedAsync(user))
|
if (!await spotifyApiClient.IsUserAuthenticatedAsync(user))
|
||||||
{
|
{
|
||||||
logger.LogWarning($"User {user.LdapUserName} is not authorized with Spotify - skipping playlist sync");
|
logger.LogWarning($"User {user.LdapUserName} is not authorized with Spotify - skipping playlist sync");
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
var foundPlaylist = dci.SmartPlaylistDefinitions?.Where(p => p.CreatedBy == user).ToList().Where(p => p.IsThisUsersLikedSongsPlaylist).SingleOrDefault();
|
else
|
||||||
if (foundPlaylist == null)
|
|
||||||
{
|
{
|
||||||
logger.LogWarning($"Creating liked songs playlist for user {user.LdapUserName}");
|
var foundPlaylist = dci.SmartPlaylistDefinitions?.Where(p => p.CreatedBy == user).ToList().Where(p => p.IsThisUsersLikedSongsPlaylist).SingleOrDefault();
|
||||||
var title = $"{user.PreferredName}'s liked songs";
|
if (foundPlaylist == null)
|
||||||
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
|
logger.LogWarning($"Creating liked songs playlist for user {user.LdapUserName}");
|
||||||
var newPlaylist = await (await spotifyApiClient.WithUserAuthorizationAsync(user)).CreateSpotifyPlaylist(title, description, false, true, user);
|
var title = $"{user.PreferredName}'s liked songs";
|
||||||
await playlistSynchronizer.SynchronizePlaylistAsync(newPlaylist);
|
var description = $"A collection of the songs liked by {user.PreferredName} on their 'Song of the day' server instance.";
|
||||||
needsSaving = true;
|
// 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);
|
||||||
}
|
}
|
||||||
logger.LogWarning($"Syncing playlists for user {user.LdapUserName}");
|
|
||||||
await playlistSynchronizer.SynchronizeUserPlaylistsAsync(user);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needsSaving)
|
if (needsSaving)
|
||||||
|
@ -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;
|
||||||
|
@ -1 +1 @@
|
|||||||
0.6.6
|
0.6.9
|
||||||
|
Loading…
x
Reference in New Issue
Block a user