Initial support for multi library, still WIP

This commit is contained in:
emeric
2024-01-25 00:01:11 +01:00
parent f5f577af52
commit 0ed3f1ba79
85 changed files with 3076 additions and 1445 deletions
+15
View File
@@ -31,6 +31,12 @@ namespace API::Subsonic
return "ar-" + id.toString();
}
std::string idToString(Database::MediaLibraryId id)
{
// No need to prefix as this is only used at well known places
return id.toString();
}
std::string idToString(Database::ReleaseId id)
{
return "al-" + id.toString();
@@ -70,6 +76,15 @@ namespace StringUtils
return std::nullopt;
}
template<>
std::optional<Database::MediaLibraryId> readAs(std::string_view str)
{
if (const auto value{ StringUtils::readAs<Database::MediaLibraryId::ValueType>(str) })
return Database::MediaLibraryId{ *value };
return std::nullopt;
}
template<>
std::optional<Database::ReleaseId> readAs(std::string_view str)
{