Added support for apostrophes in custom collection names.

Creating new custom collections now also converts their names to lower case.
This commit is contained in:
Leon Styhre 2020-10-28 17:36:23 +01:00
parent 8a6dc3d527
commit 0955b1cf1b

View file

@ -543,7 +543,7 @@ std::string CollectionSystemManager::getValidNewCollectionName(std::string inNam
// Get valid name. // Get valid name.
while ((remove = name.find_first_not_of( while ((remove = name.find_first_not_of(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-[]() ")) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-[]()' "))
!= std::string::npos) != std::string::npos)
name.erase(remove, 1); name.erase(remove, 1);
} }
@ -552,10 +552,12 @@ std::string CollectionSystemManager::getValidNewCollectionName(std::string inNam
} }
if (name == "") { if (name == "") {
name = "New Collection"; name = "new collection";
} }
if (name != inName) { name = Utils::String::toLower(name);
if (Utils::String::toLower(name) != Utils::String::toLower(inName)) {
LOG(LogInfo) << "Had to change name, from: " << inName << " to: " << name; LOG(LogInfo) << "Had to change name, from: " << inName << " to: " << name;
} }