forked from Fascinated/Bat
big ass refactor to handle loading guilds and users without spring to make it more futureproof
This commit is contained in:
@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*/
|
||||
@Service
|
||||
@Getter
|
||||
@Log4j2
|
||||
@Log4j2(topic = "Spotify Service")
|
||||
public class SpotifyService {
|
||||
/**
|
||||
* The access token map.
|
||||
@ -189,7 +189,6 @@ public class SpotifyService {
|
||||
AuthorizationCodeCredentials credentials = api.authorizationCodeRefresh().build().execute();
|
||||
profile.setAccessToken(credentials.getAccessToken());
|
||||
profile.setExpiresAt(System.currentTimeMillis() + (credentials.getExpiresIn() * 1000));
|
||||
userService.saveUser(user);
|
||||
log.info("Refreshed Spotify token for user {}", user.getName());
|
||||
} catch (SpotifyWebApiException ex) {
|
||||
log.error("Failed to refresh Spotify token", ex);
|
||||
@ -213,7 +212,6 @@ public class SpotifyService {
|
||||
profile.setAccessToken(credentials.getAccessToken());
|
||||
profile.setRefreshToken(credentials.getRefreshToken());
|
||||
profile.setExpiresAt(System.currentTimeMillis() + (credentials.getExpiresIn() * 1000));
|
||||
userService.saveUser(user);
|
||||
log.info("Linked Spotify account for user {}", user.getName());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user