From 802ea9af30e00881ab505e22a5451f46f8df6f0b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 18 Feb 2022 19:33:17 +0100 Subject: local-anime: go to watched if we have only watched part of the video --- src/plugins/WatchProgress.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/WatchProgress.cpp b/src/plugins/WatchProgress.cpp index c3e2fb7..db12273 100644 --- a/src/plugins/WatchProgress.cpp +++ b/src/plugins/WatchProgress.cpp @@ -89,7 +89,16 @@ namespace QuickMedia { bool watched = false; Json::Value &watched_item = json_root[id]; if(watched_item.isObject()) { - watched = true; + const Json::Value &time_json = watched_item["time"]; + const Json::Value &duration_json = watched_item["duration"]; + if(time_json.isInt64() && duration_json.isInt64()) { + WatchProgress watch_progress; + watch_progress.time_pos_sec = time_json.asInt64(); + watch_progress.duration_sec = duration_json.asInt64(); + watched = watch_progress.has_finished_watching(); + } else { + watched = false; + } } else { watched_item = Json::Value(Json::objectValue); watched = false; -- cgit v1.2.3