Mercurial > minori
diff src/services/anilist.cpp @ 64:fe719c109dbc
*: update
1. add media tracking ability, and it displays info on the `now playing` page
2. the `now playing` page now actually shows something
3. renamed every page class to be more accurate to what it is
4. ...
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 01 Oct 2023 23:15:43 -0400 |
parents | 3d2decf093bb |
children | 26721c28bf22 |
line wrap: on
line diff
--- a/src/services/anilist.cpp Sun Oct 01 06:39:47 2023 -0400 +++ b/src/services/anilist.cpp Sun Oct 01 23:15:43 2023 -0400 @@ -6,7 +6,6 @@ #include "core/session.h" #include "core/strings.h" #include "gui/translate/anilist.h" -#include <QDebug> #include <QDesktopServices> #include <QInputDialog> #include <QLineEdit> @@ -17,7 +16,7 @@ #include <exception> #define CLIENT_ID "13706" -using nlohmann::literals::operator"" _json_pointer; +using namespace nlohmann::literals::json_literals; namespace Services { namespace AniList { @@ -39,7 +38,7 @@ static Account account; static size_t CurlWriteCallback(void* contents, size_t size, size_t nmemb, void* userdata) { - ((std::string*)userdata)->append((char*)contents, size * nmemb); + reinterpret_cast<std::string*>(userdata)->append(reinterpret_cast<char*>(contents), size * nmemb); return size * nmemb; } @@ -117,6 +116,8 @@ Date ParseDate(const nlohmann::json& json) { Date date; + /* JSON for Modern C++ warns here. I'm not too sure why, this code works when I set the + standard to C++17 :/ */ if (json.contains("/year"_json_pointer) && json.at("/year"_json_pointer).is_number()) date.SetYear(JSON::GetInt(json, "/year"_json_pointer)); else