diff src/core/date.cpp @ 77:6f7385bd334c

*: update formatted all source files, no more subclassing QThread... many other changes :)
author Paper <mrpapersonic@gmail.com>
date Fri, 06 Oct 2023 06:18:53 -0400
parents 3d2decf093bb
children
line wrap: on
line diff
--- a/src/core/date.cpp	Wed Oct 04 01:46:33 2023 -0400
+++ b/src/core/date.cpp	Fri Oct 06 06:18:53 2023 -0400
@@ -105,18 +105,18 @@
 }
 
 nlohmann::json Date::GetAsAniListJson() const {
-	nlohmann::json result;
+	nlohmann::json result = {};
 	if (year.get())
-		result.insert(result.end(), {"year", *year});
+		result["year"] = *year;
 	else
-		result.insert(result.end(), {"year", nullptr});
+		result["year"] = nullptr;
 	if (month.get())
-		result.insert(result.end(), {"month", *month});
+		result["month"] = *month;
 	else
-		result.insert(result.end(), {"month", nullptr});
+		result["month"] = nullptr;
 	if (day.get())
-		result.insert(result.end(), {"day", *day});
+		result["day"] = *day;
 	else
-		result.insert(result.end(), {"day", nullptr});
+		result["day"] = nullptr;
 	return result;
 }