diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-02-18 19:33:17 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-02-18 19:33:17 +0100 |
commit | 802ea9af30e00881ab505e22a5451f46f8df6f0b (patch) | |
tree | 25edb5b2a2e1cc9e504ed7cde5d363d57d8692d8 | |
parent | de5fa7773f0393bfab917f8bf8606cb38ba3930e (diff) |
local-anime: go to watched if we have only watched part of the video
-rw-r--r-- | src/plugins/WatchProgress.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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; |