summaryrefslogtreecommitdiff
path: root/Controllers/ApiMediaController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Controllers/ApiMediaController.cs')
-rw-r--r--Controllers/ApiMediaController.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Controllers/ApiMediaController.cs b/Controllers/ApiMediaController.cs
index a1b07b1..58fd043 100644
--- a/Controllers/ApiMediaController.cs
+++ b/Controllers/ApiMediaController.cs
@@ -1,5 +1,6 @@
using HyperBooru.ApiModels;
using HyperBooru.Services;
+using HyperBooru.Util;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
@@ -54,8 +55,8 @@ public class ApiMediaController : Controller {
if(media is null)
return NotFound();
- media.ShortDescription = updatedMedia.ShortDescription;
- media.LongDescription = updatedMedia.LongDescription;
+ media.ShortDescription = updatedMedia.ShortDescription.NullIfEmpty();
+ media.LongDescription = updatedMedia.LongDescription.NullIfEmpty();
await db.SaveChangesAsync();
await transaction.CommitAsync();
@@ -87,7 +88,7 @@ public class ApiMediaController : Controller {
metadata?.LastAccessTime,
metadata?.LastWriteTime,
metadata?.CreateTime,
- metadata?.Path,
+ metadata?.Path.NullIfEmpty(),
metadata?.PathType,
metadata?.Tags);