#include "common/converter.h"
#include "common/logger.h"
+#include "common/tools.h"
using common::AttributeMatchFlag;
using common::CompositeFilterType;
{"createdDate", "MEDIA_ADDED_TIME"},
{"releaseDate", "MEDIA_DATETAKEN"},
{"modifiedDate", "MEDIA_MODIFIED_TIME"},
- {"geolocation.latitude", "MEDIA_LATITUDE"},
- {"geolocation.longitude", "MEDIA_LONGITUDE"},
- {"duration", "MEDIA_DURATION"},
+ {"geolocation.latitude",
+ "MEDIA_LATITUDE"}, // Deprecated since 9.0 //TODO remove after 2 versions
+ {"geolocation.longitude",
+ "MEDIA_LONGITUDE"}, // Deprecated since 9.0 //TODO remove after 2 versions
+ {"duration",
+ "MEDIA_DURATION"}, // Deprecated since 9.0 //TODO remove after 2 versions
{"album", "MEDIA_ALBUM"},
{"artists", "MEDIA_ARTIST"},
{"width", "MEDIA_WIDTH"},
};
std::string escapeValueString(const std::string& data) {
- LoggerD("Enter");
+ ScopeLogger();
std::string out;
// If string won't be resized, then it will be faster
out.reserve(data.size());
} // namespace
PlatformResult ContentFilter::MapField(const std::string& name, std::string* result) {
- LoggerD("Enter");
+ ScopeLogger();
auto it = attributeNameMap.find(name);
if (it != attributeNameMap.end()) {
+ if (name == "rating" || name == "description" ||
+ name == "geolocation.latitude" || name == "geolocation.longitude" ||
+ name == "duration") {
+ std::string warning = "Filtering by attribute '" + name + "'";
+ common::tools::PrintDeprecationWarningFor(warning.c_str());
+ }
*result = it->second;
} else {
return LogAndCreateResult(ErrorCode::INVALID_VALUES_ERR);
PlatformResult ContentFilter::BuildQuery(const picojson::object& jsFilter,
std::string* queryToCall) {
- LoggerD("Enter");
+ ScopeLogger();
std::vector<std::vector<std::string>> partialqueries;
partialqueries.push_back(std::vector<std::string>());
visitor.SetOnAttributeFilter([&](const std::string& name, AttributeMatchFlag match_flag,
const picojson::value& match_value) {
- LoggerD("entered OnAttributeFilter");
+ ScopeLogger("Entered into asynchronous function, visitor.SetOnAttributeFilter's argument");
std::string query;
std::string matchValue;
});
visitor.SetOnCompositeFilterBegin([&](CompositeFilterType type) {
- LoggerD("entered OnCompositeFilterBegin");
+ ScopeLogger("Entered into asynchronous function, visitor.SetOnCompositeFilterBegin's argument");
partialqueries.push_back(std::vector<std::string>());
return PlatformResult(ErrorCode::NO_ERROR);
});
visitor.SetOnCompositeFilterEnd([&](CompositeFilterType calType) {
- LoggerD("entered OnCompositeFilterEnd");
+ ScopeLogger("Entered into asynchronous function, visitor.SetOnCompositeFilterEnd's argument");
std::string finalQuery;
std::string separator;
visitor.SetOnAttributeRangeFilter([&](const std::string& name,
const picojson::value& initial_value,
const picojson::value& end_value) {
- LoggerD("entered OnAttributeFilter");
+ ScopeLogger("Entered into asynchronous function, visitor.SetOnAttributeRangeFilter's argument");
std::string query = "";
std::string paramName;