comparison src/core/anime_db.cc @ 236:4d461ef7d424

HUGE UPDATE: convert build system to autotools why? because cmake sucks :)
author Paper <mrpapersonic@gmail.com>
date Fri, 19 Jan 2024 00:24:02 -0500
parents bc1ae1810855
children d14f8e0e40c3
comparison
equal deleted inserted replaced
235:593108b3d555 236:4d461ef7d424
143 return 0; 143 return 0;
144 144
145 std::unordered_map<int, size_t> map; 145 std::unordered_map<int, size_t> map;
146 146
147 static const auto process_title = [&map](const Anime& anime, const std::string& title, const std::string& needle) -> bool { 147 static const auto process_title = [&map](const Anime& anime, const std::string& title, const std::string& needle) -> bool {
148 size_t ret = title.find(needle); 148 const std::string title_l = Strings::ToLower(title), needle_l = Strings::ToLower(needle);
149 size_t ret = title_l.find(needle_l);
149 if (ret == std::string::npos) 150 if (ret == std::string::npos)
150 return false; 151 return false;
151 152
152 map[anime.GetId()] = title.length() - (ret + needle.length()); 153 map[anime.GetId()] = title.length() - (ret + needle.length());
153 return true; 154 return true;