Increment View count

misc fixes
This commit is contained in:
2025-04-15 23:07:54 -04:00
parent 1c9127ca19
commit d3a139feb5
5 changed files with 18 additions and 31 deletions

View File

@@ -6,13 +6,13 @@ namespace AobaServer.Controllers.Api;
public class AuthApi : ControllerBase
{
[HttpGet("login")]
public async Task<IActionResult> LoginAsync()
public Task<IActionResult> LoginAsync()
{
throw new NotImplementedException();
}
[HttpGet("register")]
public async Task<IActionResult> RegisterAsync()
public Task<IActionResult> RegisterAsync()
{
throw new NotImplementedException();
}

View File

@@ -10,7 +10,7 @@ using MongoDB.Driver;
namespace AobaServer.Controllers;
[Route("/m")]
public class MediaController(MediaService mediaService, ILogger<MediaController> logger) : Controller
public class MediaController(MediaService mediaService, AobaService aobaService, ILogger<MediaController> logger) : Controller
{
[HttpGet("{id}")]
[ResponseCache(Duration = int.MaxValue)]
@@ -23,6 +23,7 @@ public class MediaController(MediaService mediaService, ILogger<MediaController>
return NotFound();
}
var mime = MimeTypesMap.GetMimeType(file.Value.FileInfo.Filename);
_ = aobaService.IncrementFileViewCountAsync(id);
return File(file, mime, true);
}