rinov/YoutubeKit

Search list with resource type parameter is not working.

geek1706 opened this issue · 1 comments

I tried to make a request as bellow.
let request = SearchListRequest(part: [.id, .snippet], maxResults: 50, searchQuery: query, resourceType: [.video])

It seems that urls are not encoded correctly? Here is raw request.

https://www.googleapis.com/youtube/v3/search?q=martin%20garrix&part=id,snippet&maxResults=50&type=%5BYoutubeKit.SearchResourceType.video%5D&key=AIzaSyD6nhLVUlbucqRO_uRw-X8ZQXzk-xlu8iM

if let types = self.resourceType{
            var arrStrType = [String]()
            for type in types{
                arrStrType.append(type.rawValue)
            }
            let strType = arrStrType.joined(separator: ",")
            q.appendingQueryParameter(key: "type", value: strType)
            print(strType)
        }
        
//        q.appendingQueryParameter(key: "type", value: resourceType)