Commit 0f444dc7 by Paweł Wegner

YouTube: reverted getItemDataRequest.

parent 57a7c14e
......@@ -307,6 +307,22 @@ ICloudProvider::GetItemUrlRequest::IRequest::Pointer YouTube::getItemUrlAsync(
->run();
}
IHttpRequest::Pointer YouTube::getItemDataRequest(const std::string& full_id,
std::ostream&) const {
auto id_data = from_string(full_id);
if (!id_data.playlist) {
auto request = http()->create(endpoint() + "/youtube/v3/videos", "GET");
request->setParameter("part", "contentDetails,snippet");
request->setParameter("id", id_data.id);
return request;
} else {
auto request = http()->create(endpoint() + "/youtube/v3/playlists", "GET");
request->setParameter("part", "contentDetails,snippet");
request->setParameter("id", id_data.id);
return request;
}
}
IHttpRequest::Pointer YouTube::listDirectoryRequest(
const IItem& item, const std::string& page_token, std::ostream&) const {
if (item.id() == rootDirectory()->id() || item.id() == AUDIO_DIRECTORY_ID) {
......
......@@ -54,6 +54,8 @@ class YouTube : public CloudProvider {
const IItem&, const std::string& page_token,
std::ostream& input_stream) const override;
IHttpRequest::Pointer getItemDataRequest(const std::string& full_id,
std::ostream&) const override;
IItem::Pointer getItemDataResponse(std::istream& response, bool audio) const;
std::vector<IItem::Pointer> listDirectoryResponse(
const IItem& directory, std::istream&,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment