aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Config.cpp7
-rw-r--r--src/plugins/Youtube.cpp4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/Config.cpp b/src/Config.cpp
index a1752b1..e0f39fd 100644
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -178,6 +178,13 @@ namespace QuickMedia {
config->local_anime.auto_group_episodes = auto_group_episodes_json.asBool();
}
+ const Json::Value &youtube_json = json_root["youtube"];
+ if(youtube_json.isObject()) {
+ const Json::Value &load_progress_json = youtube_json["load_progress"];
+ if(load_progress_json.isBool())
+ config->youtube.load_progress = load_progress_json.asBool();
+ }
+
const Json::Value &use_system_fonts_json = json_root["use_system_fonts"];
if(use_system_fonts_json.isBool())
config->use_system_fonts = use_system_fonts_json.asBool();
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index bbf3108..f8e39cf 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -7,6 +7,7 @@
#include "../../include/VideoPlayer.hpp"
#include "../../include/Utils.hpp"
#include "../../include/Theme.hpp"
+#include "../../include/Config.hpp"
#include "../../plugins/WatchProgress.hpp"
#include <optional>
#include <json/reader.h>
@@ -1863,6 +1864,9 @@ namespace QuickMedia {
if(!timestamp.empty())
return timestamp;
+ if(!get_config().youtube.load_progress)
+ return "";
+
std::string video_id;
if(!youtube_url_extract_id(url, video_id)) {
fprintf(stderr, "Failed to extract youtube id from %s\n", url.c_str());