62 lines
3 KiB
Java
62 lines
3 KiB
Java
package com.discord.utilities.integrations;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.net.Uri;
|
|
import com.discord.api.activity.ActivityMetadata;
|
|
import com.discord.utilities.rest.RestAPI;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import d0.z.d.o;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
/* compiled from: SpotifyHelper.kt */
|
|
public final class SpotifyHelper$launchAlbum$1 extends o implements Function0<Unit> {
|
|
public final /* synthetic */ long $applicationId;
|
|
public final /* synthetic */ Context $context;
|
|
public final /* synthetic */ String $sessionId;
|
|
public final /* synthetic */ long $userId;
|
|
|
|
/* compiled from: SpotifyHelper.kt */
|
|
/* renamed from: com.discord.utilities.integrations.SpotifyHelper$launchAlbum$1$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function1<ActivityMetadata, Unit> {
|
|
public final /* synthetic */ SpotifyHelper$launchAlbum$1 this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass1(SpotifyHelper$launchAlbum$1 spotifyHelper$launchAlbum$1) {
|
|
super(1);
|
|
this.this$0 = spotifyHelper$launchAlbum$1;
|
|
}
|
|
|
|
/* 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(ActivityMetadata activityMetadata) {
|
|
invoke(activityMetadata);
|
|
return Unit.a;
|
|
}
|
|
|
|
public final void invoke(ActivityMetadata activityMetadata) {
|
|
String a;
|
|
if (activityMetadata != null && (a = activityMetadata.a()) != null) {
|
|
String encode = Uri.encode(a);
|
|
SpotifyHelper.access$launchSpotifyIntent(SpotifyHelper.INSTANCE, this.this$0.$context, new Intent("android.intent.action.VIEW", Uri.parse("spotify:album:" + encode + "?utm_source=discord&utm_medium=mobile")));
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public SpotifyHelper$launchAlbum$1(long j, String str, long j2, Context context) {
|
|
super(0);
|
|
this.$userId = j;
|
|
this.$sessionId = str;
|
|
this.$applicationId = j2;
|
|
this.$context = context;
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
/* renamed from: invoke */
|
|
public final void mo1invoke() {
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().getActivityMetadata(this.$userId, this.$sessionId, this.$applicationId), false, 1, null)), this.$context, "REST: Spotify GetActivityMetadata", (Function1) null, new AnonymousClass1(this), (Function1) null, (Function0) null, (Function0) null, 116, (Object) null);
|
|
}
|
|
}
|