Initial support for multi library, still WIP
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user