From e3a151d5d2a71126c275567862a0cd2d471b42bc Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 4 Sep 2022 22:35:17 +0200 Subject: Dramacool: watch progress --- plugins/utils/WatchProgress.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 plugins/utils/WatchProgress.hpp (limited to 'plugins/utils/WatchProgress.hpp') diff --git a/plugins/utils/WatchProgress.hpp b/plugins/utils/WatchProgress.hpp new file mode 100644 index 0000000..48f549c --- /dev/null +++ b/plugins/utils/WatchProgress.hpp @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include + +namespace QuickMedia { + enum class WatchedStatus { + WATCHED, + NOT_WATCHED + }; + + struct WatchProgress { + int64_t time_pos_sec = 0; + int64_t duration_sec = 0; + time_t timestamp = 0; + std::string thumbnail_url; + + double get_watch_ratio() const; + bool has_finished_watching() const; + }; + + bool set_watch_progress_for_plugin(const char *plugin_name, const std::string &id, int64_t time_pos_sec, int64_t duration_sec, const std::string &thumbnail_url); + std::unordered_map get_watch_progress_for_plugin(const char *plugin_name); + bool toggle_watched_for_plugin_save_to_file(const char *plugin_name, const std::string &id, int64_t duration_sec, const std::string &thumbnail_url, WatchedStatus &watched_status); +} \ No newline at end of file -- cgit v1.2.3