Mercurial > minori
diff include/core/anime_db.h @ 202:71832ffe425a
animia: re-add kvm fd source
this is all being merged from my wildly out-of-date laptop. SORRY!
in other news, I edited the CI file to install the wayland client
as well, so the linux CI build might finally get wayland stuff.
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 02 Jan 2024 06:05:06 -0500 |
parents | 122fad646f81 |
children | 862d0d8619f6 |
line wrap: on
line diff
--- a/include/core/anime_db.h Sun Nov 19 19:13:28 2023 -0500 +++ b/include/core/anime_db.h Tue Jan 02 06:05:06 2024 -0500 @@ -2,6 +2,7 @@ #define __core__anime_db_h #include "core/anime.h" +#include "json/json_fwd.hpp" #include <string> #include <unordered_map> @@ -10,14 +11,20 @@ class Database { public: std::unordered_map<int, Anime> items; - int GetTotalAnimeAmount(); - int GetTotalEpisodeAmount(); - int GetTotalWatchedAmount(); - int GetTotalPlannedAmount(); + size_t GetTotalAnimeAmount(); + size_t GetTotalEpisodeAmount(); + size_t GetTotalWatchedAmount(); + size_t GetTotalPlannedAmount(); double GetAverageScore(); double GetScoreDeviation(); - int GetListsAnimeAmount(ListStatus status); + size_t GetListsAnimeAmount(ListStatus status); int GetAnimeFromTitle(const std::string& title); + + bool GetDatabaseAsJSON(nlohmann::json& json); + bool SaveDatabaseToDisk(); + + bool ParseDatabaseJSON(const nlohmann::json& json); + bool LoadDatabaseFromDisk(); }; extern Database db;