The 10th Polish Pass (#4349)

This commit is contained in:
Joe Milazzo
2026-01-13 14:56:14 -07:00
committed by GitHub
parent 1fd3e5af3c
commit 7c2be140c7
5 changed files with 87 additions and 4 deletions
+15 -1
View File
@@ -141,6 +141,13 @@ public class LibraryController : BaseApiController
if (!await _unitOfWork.CommitAsync()) return BadRequest(await _localizationService.Translate(UserId, "generic-library"));
// I added this twice as some users were having issues where their new library wasn't added to the side nav.
// I wasn't able to reproduce but could validate it didn't happen with this extra commit. (https://github.com/Kareadita/Kavita/issues/4248)
if (_unitOfWork.HasChanges())
{
await _unitOfWork.CommitAsync();
}
await _libraryCacheProvider.RemoveByPrefixAsync(CacheKey);
if (library.FolderWatching)
@@ -485,7 +492,14 @@ public class LibraryController : BaseApiController
try
{
return Ok(await DeleteLibrary(libraryId, UserId));
var result = await DeleteLibrary(libraryId, UserId);
if (result)
{
// Inform the user's side nav to remove it if needed
await _eventHub.SendMessageAsync(MessageFactory.SideNavUpdate,
MessageFactory.SideNavUpdateEvent(UserId), false);
}
return Ok(result);
}
catch (Exception ex)
{