Skip to content

Commit

Permalink
Fixed a bug where creating a new library wasn't including if folder w…
Browse files Browse the repository at this point in the history
…atching was on
  • Loading branch information
majora2007 committed Jan 27, 2024
1 parent 6838ac9 commit 27ffbc3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions API/Controllers/LibraryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ public async Task<ActionResult> AddLibrary(UpdateLibraryDto dto)
if (!await _unitOfWork.CommitAsync()) return BadRequest(await _localizationService.Translate(User.GetUserId(), "generic-library"));
_logger.LogInformation("Created a new library: {LibraryName}", library.Name);

// Restart Folder watching if on
var settings = await _unitOfWork.SettingsRepository.GetSettingsDtoAsync();
if (settings.EnableFolderWatching)
{
await _libraryWatcher.RestartWatching();
}

// Assign all the necessary users with this library side nav
var userIds = admins.Select(u => u.Id).Append(User.GetUserId()).ToList();
var userNeedingNewLibrary = (await _unitOfWork.UserRepository.GetAllUsersAsync(AppUserIncludes.SideNavStreams))
Expand Down

0 comments on commit 27ffbc3

Please sign in to comment.