Spotify OAuth & Presence

This commit is contained in:
2025-11-02 15:32:20 +08:00
parent c74ab20236
commit 6817ab6b56
7 changed files with 502 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
using DysonNetwork.Pass.Account;
using DysonNetwork.Pass.Account.Presences;
using DysonNetwork.Pass.Credit;
using DysonNetwork.Pass.Handlers;
using DysonNetwork.Pass.Wallet;
@@ -81,6 +83,16 @@ public static class ScheduledJobsConfiguration
.ForJob(socialCreditValidationJob)
.WithIdentity("SocialCreditValidationTrigger")
.WithCronSchedule("0 0 0 * * ?"));
var spotifyPresenceUpdateJob = new JobKey("SpotifyPresenceUpdate");
q.AddJob<SpotifyPresenceUpdateJob>(opts => opts.WithIdentity(spotifyPresenceUpdateJob));
q.AddTrigger(opts => opts
.ForJob(spotifyPresenceUpdateJob)
.WithIdentity("SpotifyPresenceUpdateTrigger")
.WithSimpleSchedule(o => o
.WithIntervalInMinutes(2)
.RepeatForever())
);
});
services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);

View File

@@ -57,12 +57,14 @@ public static class ServiceCollectionExtensions
services.AddScoped<OidcService, MicrosoftOidcService>();
services.AddScoped<OidcService, DiscordOidcService>();
services.AddScoped<OidcService, AfdianOidcService>();
services.AddScoped<OidcService, SpotifyOidcService>();
services.AddScoped<GoogleOidcService>();
services.AddScoped<AppleOidcService>();
services.AddScoped<GitHubOidcService>();
services.AddScoped<MicrosoftOidcService>();
services.AddScoped<DiscordOidcService>();
services.AddScoped<AfdianOidcService>();
services.AddScoped<SpotifyOidcService>();
services.AddControllers().AddJsonOptions(options =>
{
@@ -142,6 +144,7 @@ public static class ServiceCollectionExtensions
services.AddScoped<ActionLogService>();
services.AddScoped<RelationshipService>();
services.AddScoped<MagicSpellService>();
services.AddScoped<DysonNetwork.Pass.Account.Presences.SpotifyPresenceService>();
services.AddScoped<AuthService>();
services.AddScoped<TokenAuthService>();
services.AddScoped<AccountUsernameService>();