aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Youtube.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Youtube.cpp')
-rw-r--r--src/plugins/Youtube.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index 2827d83..4126532 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -17,7 +17,7 @@ namespace QuickMedia {
}
}
- static std::unique_ptr<BodyItem> parse_content_video_renderer(const Json::Value &content_item_json, std::unordered_set<std::string> &added_videos) {
+ static std::shared_ptr<BodyItem> parse_content_video_renderer(const Json::Value &content_item_json, std::unordered_set<std::string> &added_videos) {
if(!content_item_json.isObject())
return nullptr;
@@ -68,7 +68,7 @@ namespace QuickMedia {
if(!title)
return nullptr;
- auto body_item = std::make_unique<BodyItem>(title);
+ auto body_item = BodyItem::create(title);
/* TODO: Make date a different color */
std::string date_str;
if(date)
@@ -170,7 +170,7 @@ namespace QuickMedia {
continue;
const Json::Value &rich_item_contents = rich_item_renderer_json["content"];
- std::unique_ptr<BodyItem> body_item = parse_content_video_renderer(rich_item_contents, added_videos);
+ std::shared_ptr<BodyItem> body_item = parse_content_video_renderer(rich_item_contents, added_videos);
if(body_item)
result_items.push_back(std::move(body_item));
}
@@ -273,14 +273,14 @@ namespace QuickMedia {
continue;
for(const Json::Value &item_json : items_json) {
- std::unique_ptr<BodyItem> body_item = parse_content_video_renderer(item_json, added_videos);
+ std::shared_ptr<BodyItem> body_item = parse_content_video_renderer(item_json, added_videos);
if(body_item)
result_items.push_back(std::move(body_item));
}
}
for(const Json::Value &content_item_json : item_contents_json) {
- std::unique_ptr<BodyItem> body_item = parse_content_video_renderer(content_item_json, added_videos);
+ std::shared_ptr<BodyItem> body_item = parse_content_video_renderer(content_item_json, added_videos);
if(body_item)
result_items.push_back(std::move(body_item));
}
@@ -444,7 +444,7 @@ namespace QuickMedia {
return result.substr(0, index);
}
- static std::unique_ptr<BodyItem> parse_compact_video_renderer_json(const Json::Value &item_json, std::unordered_set<std::string> &added_videos) {
+ static std::shared_ptr<BodyItem> parse_compact_video_renderer_json(const Json::Value &item_json, std::unordered_set<std::string> &added_videos) {
const Json::Value &compact_video_renderer_json = item_json["compactVideoRenderer"];
if(!compact_video_renderer_json.isObject())
return nullptr;
@@ -487,7 +487,7 @@ namespace QuickMedia {
if(!title)
return nullptr;
- auto body_item = std::make_unique<BodyItem>(title);
+ auto body_item = BodyItem::create(title);
/* TODO: Make date a different color */
std::string date_str;
if(date)