Added a way to set custom tag delimiters for artists and for other fields, fixes #417

This commit is contained in:
emeric
2024-03-01 23:58:49 +01:00
parent 194b9981c1
commit a6d11f4b4b
45 changed files with 2261 additions and 1121 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ namespace StringUtils
std::optional<API::Subsonic::ProtocolVersion> readAs(std::string_view str)
{
// Expects "X.Y.Z"
const auto numbers{ StringUtils::splitString(str, ".") };
const auto numbers{ StringUtils::splitString(str, '.') };
if (numbers.size() < 2 || numbers.size() > 3)
return std::nullopt;
+4 -4
View File
@@ -63,7 +63,7 @@ namespace StringUtils
template<>
std::optional<Database::ArtistId> readAs(std::string_view str)
{
std::vector<std::string_view> values{ StringUtils::splitString(str, "-") };
std::vector<std::string_view> values{ StringUtils::splitString(str, '-') };
if (values.size() != 2)
return std::nullopt;
@@ -88,7 +88,7 @@ namespace StringUtils
template<>
std::optional<Database::ReleaseId> readAs(std::string_view str)
{
std::vector<std::string_view> values{ StringUtils::splitString(str, "-") };
std::vector<std::string_view> values{ StringUtils::splitString(str, '-') };
if (values.size() != 2)
return std::nullopt;
@@ -113,7 +113,7 @@ namespace StringUtils
template<>
std::optional<Database::TrackId> readAs(std::string_view str)
{
std::vector<std::string_view> values{ StringUtils::splitString(str, "-") };
std::vector<std::string_view> values{ StringUtils::splitString(str, '-') };
if (values.size() != 2)
return std::nullopt;
@@ -129,7 +129,7 @@ namespace StringUtils
template<>
std::optional<Database::TrackListId> readAs(std::string_view str)
{
std::vector<std::string_view> values{ StringUtils::splitString(str, "-") };
std::vector<std::string_view> values{ StringUtils::splitString(str, '-') };
if (values.size() != 2)
return std::nullopt;
@@ -49,7 +49,7 @@ namespace API::Subsonic
if (context.clientInfo.name == "Symfonium")
query = StringUtils::stringTrim(query, "\"");
std::vector<std::string_view> keywords{ StringUtils::splitString(query, " ") };
std::vector<std::string_view> keywords{ StringUtils::splitString(query, ' ') };
// Optional params
std::size_t artistCount{ getParameterAs<std::size_t>(context.parameters, "artistCount").value_or(20) };