aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Peertube.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-03-08 16:39:55 +0100
committerdec05eba <dec05eba@protonmail.com>2022-03-08 16:39:55 +0100
commita26d0fcc0a30a28ce0e458ea275fc0787c693bc6 (patch)
treeffe2212b81d9fdc93b49383c102e7c0ece0d225a /src/plugins/Peertube.cpp
parent21c50903a68c253fa5fcb9ed5ac8ba5abb1142b9 (diff)
Save youtube watch progress and resume next time the video is played
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"];