feat: added platforms to the API

This commit is contained in:
Michael Green
2023-06-16 23:12:48 +10:00
parent d3a90e6798
commit 4f40d04d30
4 changed files with 173 additions and 2 deletions

View File

@@ -26,7 +26,22 @@ namespace gaseous_server.Classes.Metadata
{
if (Id == 0)
{
return null;
Platform returnValue = new Platform();
if (Storage.GetCacheStatus("platform", 0) == Storage.CacheStatus.NotPresent)
{
returnValue = new Platform
{
Id = 0,
Name = "Unknown"
};
Storage.NewCacheValue(returnValue);
return returnValue;
}
else
{
return Storage.GetCacheValue<Platform>(returnValue, "id", 0);
}
}
else
{