Progress Overhaul + Profile Page and a LOT more! (#4262)

Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
Joe Milazzo
2025-12-09 10:00:11 -07:00
committed by GitHub
parent 4ac13f1f25
commit 9f29fa593d
645 changed files with 25585 additions and 4805 deletions
+6 -8
View File
@@ -11,6 +11,8 @@ using API.Exceptions;
using API.Extensions;
using API.Middleware;
using API.Services;
using API.Services.Reading;
using API.Services.Store;
using Kavita.Common;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@@ -19,14 +21,11 @@ using MimeTypes;
namespace API.Controllers;
#nullable enable
[AllowAnonymous]
[ServiceFilter(typeof(OpdsActionFilterAttribute))]
[ServiceFilter(typeof(OpdsActiveUserMiddlewareAttribute))]
public class OpdsController : BaseApiController
{
private readonly IOpdsService _opdsService;
private readonly IUserContext _userContext;
private readonly IUnitOfWork _unitOfWork;
private readonly IDownloadService _downloadService;
private readonly IDirectoryService _directoryService;
@@ -36,12 +35,10 @@ public class OpdsController : BaseApiController
private readonly ILocalizationService _localizationService;
private readonly XmlSerializer _xmlOpenSearchSerializer;
public const string UserId = nameof(UserId);
public OpdsController(IUnitOfWork unitOfWork, IDownloadService downloadService,
IDirectoryService directoryService, ICacheService cacheService,
IReaderService readerService, IAccountService accountService,
ILocalizationService localizationService, IOpdsService opdsService)
ILocalizationService localizationService, IOpdsService opdsService, IUserContext userContext)
{
_unitOfWork = unitOfWork;
_downloadService = downloadService;
@@ -51,13 +48,14 @@ public class OpdsController : BaseApiController
_accountService = accountService;
_localizationService = localizationService;
_opdsService = opdsService;
_userContext = userContext;
_xmlOpenSearchSerializer = new XmlSerializer(typeof(OpenSearchDescription));
}
private int GetUserIdFromContext()
{
return (int) HttpContext.Items[UserId]!;
return _userContext.GetUserIdOrThrow();
}
/// <summary>