58 lines
2.7 KiB
Java
58 lines
2.7 KiB
Java
|
package com.discord.utilities.spotify;
|
||
|
|
||
|
import com.discord.models.domain.ModelConnectionAccessToken;
|
||
|
import com.discord.utilities.rest.RestAPI;
|
||
|
import d0.z.d.m;
|
||
|
import d0.z.d.o;
|
||
|
import kotlin.Unit;
|
||
|
import kotlin.jvm.functions.Function0;
|
||
|
import kotlin.jvm.functions.Function1;
|
||
|
/* compiled from: SpotifyApiClient.kt */
|
||
|
public final class SpotifyApiClient$refreshSpotifyToken$1 extends o implements Function1<ModelConnectionAccessToken, Unit> {
|
||
|
public final /* synthetic */ SpotifyApiClient this$0;
|
||
|
|
||
|
/* compiled from: SpotifyApiClient.kt */
|
||
|
/* renamed from: com.discord.utilities.spotify.SpotifyApiClient$refreshSpotifyToken$1$1 reason: invalid class name */
|
||
|
public static final class AnonymousClass1 extends o implements Function0<String> {
|
||
|
public final /* synthetic */ ModelConnectionAccessToken $spotifyToken;
|
||
|
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public AnonymousClass1(ModelConnectionAccessToken modelConnectionAccessToken) {
|
||
|
super(0);
|
||
|
this.$spotifyToken = modelConnectionAccessToken;
|
||
|
}
|
||
|
|
||
|
@Override // kotlin.jvm.functions.Function0
|
||
|
/* renamed from: invoke */
|
||
|
public final String mo1invoke() {
|
||
|
return this.$spotifyToken.getAccessToken();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public SpotifyApiClient$refreshSpotifyToken$1(SpotifyApiClient spotifyApiClient) {
|
||
|
super(1);
|
||
|
this.this$0 = spotifyApiClient;
|
||
|
}
|
||
|
|
||
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
||
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
||
|
@Override // kotlin.jvm.functions.Function1
|
||
|
public /* bridge */ /* synthetic */ Unit invoke(ModelConnectionAccessToken modelConnectionAccessToken) {
|
||
|
invoke(modelConnectionAccessToken);
|
||
|
return Unit.a;
|
||
|
}
|
||
|
|
||
|
public final void invoke(ModelConnectionAccessToken modelConnectionAccessToken) {
|
||
|
m.checkNotNullParameter(modelConnectionAccessToken, "spotifyToken");
|
||
|
RestAPI.AppHeadersProvider.spotifyTokenProvider = new AnonymousClass1(modelConnectionAccessToken);
|
||
|
SpotifyApiClient spotifyApiClient = this.this$0;
|
||
|
SpotifyApiClient.access$setTokenExpiresAt(spotifyApiClient, SpotifyApiClient.access$getClock$p(spotifyApiClient).currentTimeMillis() + 3600000);
|
||
|
String access$getTrackIdToFetch = SpotifyApiClient.access$getTrackIdToFetch(this.this$0);
|
||
|
if (access$getTrackIdToFetch != null) {
|
||
|
this.this$0.fetchSpotifyTrack(access$getTrackIdToFetch);
|
||
|
SpotifyApiClient.access$setTrackIdToFetch(this.this$0, null);
|
||
|
}
|
||
|
}
|
||
|
}
|