Co-authored-by: Andre Smith <Hobogrammer@users.noreply.github.com>
This commit is contained in:
Joe Milazzo 2023-11-28 16:00:04 -06:00 committed by GitHub
parent 565a93f2d2
commit 915bf13a7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 606 additions and 342 deletions

View file

@ -40,13 +40,15 @@ public class LibraryController : BaseApiController
private readonly IEventHub _eventHub;
private readonly ILibraryWatcher _libraryWatcher;
private readonly ILocalizationService _localizationService;
private readonly IStreamService _streamService;
private readonly IEasyCachingProvider _libraryCacheProvider;
private const string CacheKey = "library_";
public LibraryController(IDirectoryService directoryService,
ILogger<LibraryController> logger, IMapper mapper, ITaskScheduler taskScheduler,
IUnitOfWork unitOfWork, IEventHub eventHub, ILibraryWatcher libraryWatcher,
IEasyCachingProviderFactory cachingProviderFactory, ILocalizationService localizationService)
IEasyCachingProviderFactory cachingProviderFactory, ILocalizationService localizationService,
IStreamService streamService)
{
_directoryService = directoryService;
_logger = logger;
@ -56,6 +58,7 @@ public class LibraryController : BaseApiController
_eventHub = eventHub;
_libraryWatcher = libraryWatcher;
_localizationService = localizationService;
_streamService = streamService;
_libraryCacheProvider = cachingProviderFactory.GetCachingProvider(EasyCacheProfiles.Library);
}
@ -240,8 +243,6 @@ public class LibraryController : BaseApiController
// Bust cache
await _libraryCacheProvider.RemoveByPrefixAsync(CacheKey);
// TODO: Update a user's SideNav based on library access
_unitOfWork.UserRepository.Update(user);
return Ok(_mapper.Map<MemberDto>(user));