From a26d0fcc0a30a28ce0e458ea275fc0787c693bc6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 8 Mar 2022 16:39:55 +0100 Subject: Save youtube watch progress and resume next time the video is played --- src/plugins/Peertube.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/Peertube.cpp') 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&, std::string &err_str) { + PluginResult PeertubeVideoPage::load(std::string &title, std::string &channel_url, double &duration, std::vector&, 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"]; -- cgit v1.2.3-70-g09d2