Tweak content flag filtering [skip ci]

This commit is contained in:
Akkadius 2020-05-24 01:36:17 -05:00
parent 56c4eb280f
commit e474df2b12
2 changed files with 5 additions and 10 deletions

View File

@ -54,22 +54,17 @@ namespace ContentFilterCriteria {
);
std::vector<std::string> flags = content_service.GetContentFlags();
for (auto &flag: flags) {
flag = "'" + flag + "'";
}
std::string flags_in_filter;
std::string flags_in_filter;
if (!flags.empty()) {
flags_in_filter = fmt::format(
" OR {}content_flags IN ({})",
" OR CONCAT(',', {}content_flags, ',') REGEXP ',({}),' ",
table_prefix,
implode(", ", flags)
implode("|", flags)
);
}
criteria += fmt::format(
" AND ({}content_flags IS NULL{})",
" AND ({}content_flags IS NULL{}) ",
table_prefix,
flags_in_filter
);

View File

@ -417,7 +417,7 @@ int main(int argc, char** argv) {
set_content_flags.push_back(flags.flag_name);
LogInfo(
"Enabling content-flag [{}]",
"Enabled content flag [{}]",
flags.flag_name
);
}