package com.gamedog.vididin.feature.home.api


import com.gamedog.vididin.VidiConst
import com.gamedog.vididin.beans.ResYoutubeChannel
import com.gamedog.vididin.beans.ResYoutubePlayList
import retrofit2.http.GET
import retrofit2.http.Query
import java.net.URLEncoder


interface YoutubeApi {

    /**
     * Youtube channel list
     */
    @GET("/youtube/v3/channels")
    suspend fun getChannelList(
        @Query("part") part: String="snippet",
        @Query("key") key: String=VidiConst.YOUTUBE_API_KEY,
        @Query("channelId") channelId: String="UCbTLwN10NoCU4WDzLf1JMOA",
        @Query("videoEmbeddable") videoEmbeddable: Boolean=true,
    ): ResYoutubeChannel


    /**
     * Youtube play list
     */
    @GET("/youtube/v3/playlists")
    suspend fun getPlayList(
        @Query("part") part: String="snippet",
        @Query("key") key: String=VidiConst.YOUTUBE_API_KEY,
        @Query("channelId") channelId: String="UCbTLwN10NoCU4WDzLf1JMOA",
    ): ResYoutubePlayList


    @GET("/youtube/v3/playlistItems")
    suspend fun getVideoList1(
        @Query("part") part: String= URLEncoder.encode("id", "UTF-8"),
        @Query("key") key: String=VidiConst.YOUTUBE_API_KEY,
        @Query("playlistId") channelId: String="PLcVfz1-_0rj_KFKlQeW2ZJnWTSjgc-9Jp",
        @Query("videoEmbeddable") videoEmbeddable: Boolean=true,
        //@Query("pageToken") pageToken: String=""
    ): ResYoutubePlayList

    @GET("/youtube/v3/videos")
    suspend fun getVideoList_old(
        @Query("part") part: String= URLEncoder.encode("snippet", "UTF-8"),
        @Query("key") key: String= VidiConst.YOUTUBE_API_KEY,
        @Query("videoDuration") videoDuration: String= "short",
        @Query("chart") chart: String="mostPopular",
        @Query("regionCode") regionCode: String="BR",
        @Query("maxResults") maxResults: Int=3,
        @Query("videoEmbeddable") videoEmbeddable: Boolean=true,
        @Query("pageToken") pageToken: String?=""
    ): ResYoutubePlayList


    @GET("/videos")
    suspend fun getVideoList(
        @Query("video") video: String? = URLEncoder.encode("", "UTF-8"),
    ): ResYoutubePlayList

}