aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Peertube.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/Peertube.cpp')
-rw-r--r--src/plugins/Peertube.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/Peertube.cpp b/src/plugins/Peertube.cpp
index a5c5865..a9620f2 100644
--- a/src/plugins/Peertube.cpp
+++ b/src/plugins/Peertube.cpp
@@ -370,7 +370,7 @@ namespace QuickMedia {
}
// TODO: Media chapters
- PluginResult PeertubeVideoPage::load(std::string &title, std::string &channel_url, std::vector<MediaChapter>&, std::string &err_str) {
+ PluginResult PeertubeVideoPage::load(std::string &title, std::string &channel_url, double &duration, std::vector<MediaChapter>&, std::string &err_str) {
Json::Value json_root;
std::string err_msg;
DownloadResult download_result = download_json(json_root, server + "/api/v1/videos/" + url, {}, true, &err_msg);
@@ -386,6 +386,10 @@ namespace QuickMedia {
if(name_json.isString())
title = name_json.asString();
+ const Json::Value &duration_json = json_root["duration"];
+ if(duration_json.isInt64())
+ duration = duration_json.asInt64();
+
const Json::Value &channel_json = json_root["channel"];
if(channel_json.isObject()) {
const Json::Value &channel_url_json = channel_json["url"];