aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/WatchProgress.cpp11
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;