Bookmark RBS + Dynamic PGO (#1503)

* Allow .NET to optimize code as it's running.

* Implemented the ability to restrict users Bookmark ability. By default, users will need to now opt-in to get bookmark roles.

* Fixed a tachiyomi progress syncing logic bug
This commit is contained in:
Joseph Milazzo 2022-09-02 11:40:52 -05:00 committed by GitHub
parent 30500a441c
commit 2283ae5d61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 75 additions and 28 deletions

View file

@ -31,10 +31,12 @@ namespace API.Controllers
private readonly IEventHub _eventHub;
private readonly ILogger<DownloadController> _logger;
private readonly IBookmarkService _bookmarkService;
private readonly IAccountService _accountService;
private const string DefaultContentType = "application/octet-stream";
public DownloadController(IUnitOfWork unitOfWork, IArchiveService archiveService, IDirectoryService directoryService,
IDownloadService downloadService, IEventHub eventHub, ILogger<DownloadController> logger, IBookmarkService bookmarkService)
IDownloadService downloadService, IEventHub eventHub, ILogger<DownloadController> logger, IBookmarkService bookmarkService,
IAccountService accountService)
{
_unitOfWork = unitOfWork;
_archiveService = archiveService;
@ -43,6 +45,7 @@ namespace API.Controllers
_eventHub = eventHub;
_logger = logger;
_bookmarkService = bookmarkService;
_accountService = accountService;
}
/// <summary>
@ -109,7 +112,7 @@ namespace API.Controllers
private async Task<bool> HasDownloadPermission()
{
var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(User.GetUsername());
return await _downloadService.HasDownloadPermission(user);
return await _accountService.HasDownloadPermission(user);
}
private ActionResult GetFirstFileDownload(IEnumerable<MangaFile> files)