package com.ss.android.ugc.aweme.choosemusic.api;

import X.0Gp;
import X.2b0;
import X.C5414OUn;
import X.JMA;
import X.OUC;
import X.OUW;
import X.PUw;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.base.api.BaseResponse;
import com.ss.android.ugc.aweme.commerce.tools.common.CommerceToolsService;
import com.ss.android.ugc.aweme.commercialize.media.impl.service.CommerceMediaServiceImpl;
import com.ss.android.ugc.aweme.music.model.CollectedMusicList;
import com.ss.android.ugc.aweme.music.model.MusicCollection;
import com.ss.android.ugc.aweme.music.model.MusicList;

public final class ChooseMusicApi {
    public static API LIZ = ((API) 2b0.LIZ(OUC.LIZ, API.class));

    public interface API {
        static {
            Covode.recordClassIndex(56026);
        }

        @JMA(LIZ = "/aweme/v1/music/collect/")
        0Gp<BaseResponse> collectMusic(@PUw(LIZ = "music_id") String str, @PUw(LIZ = "action") int i);

        @JMA(LIZ = "/aweme/v1/commerce/music/collection/feed/")
        0Gp<OUW> commerceMusicCollectionFeed(@PUw(LIZ = "cursor") Integer num, @PUw(LIZ = "count") Integer num2);

        @JMA(LIZ = "/aweme/v1/commerce/music/list/")
        0Gp<MusicList> commerceMusicList(@PUw(LIZ = "mc_id") String str, @PUw(LIZ = "cursor") int i, @PUw(LIZ = "count") int i2, @PUw(LIZ = "ai_recommend") int i3);

        @JMA(LIZ = "/aweme/v1/commerce/music/pick/")
        0Gp<C5414OUn> commerceMusicPick(@PUw(LIZ = "radio_cursor") Integer num, @PUw(LIZ = "extra_music_ids") String str, @PUw(LIZ = "is_commerce_music") Boolean bool);

        @JMA(LIZ = "/aweme/v1/commerce/music/choices/")
        0Gp<MusicList> getCommerceMusicList();

        @JMA(LIZ = "/aweme/v1/commerce/music/collection/")
        0Gp<MusicCollection> getCommerceMusicSheet(@PUw(LIZ = "cursor") int i, @PUw(LIZ = "count") int i2);

        @JMA(LIZ = "/aweme/v1/hot/music/")
        0Gp<MusicList> getHotMusicList(@PUw(LIZ = "cursor") int i, @PUw(LIZ = "count") int i2, @PUw(LIZ = "not_duplicate") boolean z, @PUw(LIZ = "sound_page_scene") int i3, @PUw(LIZ = "is_commercial_sound_page") int i4);

        @JMA(LIZ = "/aweme/v1/music/collection/")
        0Gp<MusicCollection> getMusicSheet(@PUw(LIZ = "cursor") int i, @PUw(LIZ = "count") int i2, @PUw(LIZ = "sound_page_scene") int i3);

        @JMA(LIZ = "/aweme/v1/music/recommend/by/video/")
        0Gp<MusicList> getRecommenMusicListFromAI(@PUw(LIZ = "cursor") int i, @PUw(LIZ = "count") int i2, @PUw(LIZ = "from") String str, @PUw(LIZ = "zip_uri") String str2, @PUw(LIZ = "music_ailab_ab") String str3, @PUw(LIZ = "creation_id") String str4, @PUw(LIZ = "micro_app_id") String str5, @PUw(LIZ = "video_duration") long j);

        @JMA(LIZ = "/aweme/v1/sticker/music")
        0Gp<MusicList> getStickerMusic(@PUw(LIZ = "sticker") String str);

        @JMA(LIZ = "/aweme/v1/music/collection/feed/")
        0Gp<OUW> musicCollectionFeed(@PUw(LIZ = "cursor") Integer num, @PUw(LIZ = "count") Integer num2, @PUw(LIZ = "sound_page_scene") int i);

        @JMA(LIZ = "/aweme/v1/music/list/")
        0Gp<MusicList> musicList(@PUw(LIZ = "mc_id") String str, @PUw(LIZ = "cursor") int i, @PUw(LIZ = "count") int i2, @PUw(LIZ = "sound_page_scene") int i3);

        @JMA(LIZ = "/aweme/v1/music/pick/")
        0Gp<C5414OUn> musicPick(@PUw(LIZ = "radio_cursor") Integer num, @PUw(LIZ = "extra_music_ids") String str, @PUw(LIZ = "is_commerce_music") Boolean bool, @PUw(LIZ = "sound_page_scene") Integer num2, @PUw(LIZ = "zip_uri") String str2);

        @JMA(LIZ = "/aweme/v1/music/list/")
        0Gp<MusicList> secondLevelMusicList(@PUw(LIZ = "mc_id") String str, @PUw(LIZ = "cursor") int i, @PUw(LIZ = "count") int i2, @PUw(LIZ = "level") int i3, @PUw(LIZ = "sound_page_scene") int i4);

        @JMA(LIZ = "/aweme/v1/user/music/collect/")
        0Gp<CollectedMusicList> userCollectedMusicList(@PUw(LIZ = "cursor") int i, @PUw(LIZ = "count") int i2, @PUw(LIZ = "scene") String str, @PUw(LIZ = "sound_page_scene") int i3);
    }

    static {
        Covode.recordClassIndex(56025);
    }

    public static boolean LIZ() {
        return CommerceMediaServiceImpl.LJI().LJ();
    }

    public static 0Gp<MusicCollection> LIZ(int i, int i2) {
        if (LIZ()) {
            return LIZ.getCommerceMusicSheet(i, 20);
        }
        return LIZ.getMusicSheet(i, 20, i2);
    }

    public static 0Gp<CollectedMusicList> LIZ(int i, int i2, int i3) {
        if (LIZ()) {
            return LIZ.userCollectedMusicList(i, i2, "commerce", i3);
        }
        return LIZ.userCollectedMusicList(i, i2, "", i3);
    }

    public static 0Gp<MusicList> LIZ(int i, int i2, boolean z, int i3) {
        return LIZ.getHotMusicList(i, i2, z, i3, LIZ() ? 1 : 0);
    }

    public static 0Gp<MusicList> LIZIZ(String str, int i, int i2, int i3, int i4) {
        return LIZ.secondLevelMusicList(str, i, i2, i3, i4);
    }

    public static 0Gp<C5414OUn> LIZ(Integer num, String str, boolean z, int i, String str2) {
        if (LIZ()) {
            return LIZ.commerceMusicPick(num, str, Boolean.valueOf(z));
        }
        return LIZ.musicPick(num, str, Boolean.valueOf(z), Integer.valueOf(i), str2);
    }

    public static 0Gp<MusicList> LIZ(String str, int i, int i2, int i3, int i4) {
        if (LIZ()) {
            return LIZ.commerceMusicList(str, i, i2, CommerceToolsService.LIZ().getMusicContext().getInAiRecommendedPlaylist() ? 1 : 0);
        }
        if (i3 == 0) {
            return LIZ.musicList(str, i, i2, i4);
        }
        return LIZIZ(str, i, i2, i3, i4);
    }
}
