🐛 Fix Spotify OIDC
This commit is contained in:
@@ -31,7 +31,7 @@ public class SpotifyPresenceService(
|
||||
/// <summary>
|
||||
/// Updates the Spotify presence activity for a specific user
|
||||
/// </summary>
|
||||
public async Task UpdateSpotifyPresenceAsync(SnAccount account)
|
||||
private async Task UpdateSpotifyPresenceAsync(SnAccount account)
|
||||
{
|
||||
var connection = await db.AccountConnections
|
||||
.FirstOrDefaultAsync(c => c.AccountId == account.Id && c.Provider == "spotify");
|
||||
@@ -104,7 +104,7 @@ public class SpotifyPresenceService(
|
||||
);
|
||||
}
|
||||
|
||||
private async Task<SnPresenceActivity> ParseAndCreatePresenceActivityAsync(Guid accountId, string currentlyPlayingJson)
|
||||
private static Task<SnPresenceActivity> ParseAndCreatePresenceActivityAsync(Guid accountId, string currentlyPlayingJson)
|
||||
{
|
||||
var document = JsonDocument.Parse(currentlyPlayingJson);
|
||||
var root = document.RootElement;
|
||||
@@ -178,7 +178,7 @@ public class SpotifyPresenceService(
|
||||
contextUrl = contextExternalUrls.GetProperty("spotify").GetString();
|
||||
}
|
||||
|
||||
return new SnPresenceActivity
|
||||
return Task.FromResult(new SnPresenceActivity
|
||||
{
|
||||
AccountId = accountId,
|
||||
Type = PresenceType.Music,
|
||||
@@ -204,6 +204,6 @@ public class SpotifyPresenceService(
|
||||
["spotify_track_url"] = trackUrl,
|
||||
["updated_at"] = SystemClock.Instance.GetCurrentInstant()
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class SpotifyOidcService(
|
||||
{ "client_id", config.ClientId },
|
||||
{ "redirect_uri", config.RedirectUri },
|
||||
{ "response_type", "code" },
|
||||
{ "scope", "user-read-private user-read-current-playing user-read-email" },
|
||||
{ "scope", "user-read-private user-read-email user-read-currently-playing" },
|
||||
{ "state", state },
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user