mirror of
https://github.com/Readarr/Readarr
synced 2025-12-14 20:36:18 +01:00
Fixed: Deleted books removed from UI
This commit is contained in:
parent
a3a914adfe
commit
d6e55e2913
3 changed files with 8 additions and 2 deletions
|
|
@ -114,7 +114,12 @@ public void Handle(BookEditedEvent message)
|
|||
public void Handle(BookFileDeletedEvent message)
|
||||
{
|
||||
_cache.Remove("AllAuthors");
|
||||
_cache.Remove(message.BookFile.Author.Value.Id.ToString());
|
||||
|
||||
var authorId = message.BookFile.Author?.Value?.Id.ToString();
|
||||
if (authorId != null)
|
||||
{
|
||||
_cache.Remove(authorId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ public class BookController : BookControllerWithSignalR,
|
|||
IHandle<BookGrabbedEvent>,
|
||||
IHandle<BookEditedEvent>,
|
||||
IHandle<BookUpdatedEvent>,
|
||||
IHandle<BookDeletedEvent>,
|
||||
IHandle<BookImportedEvent>,
|
||||
IHandle<TrackImportedEvent>,
|
||||
IHandle<BookFileDeletedEvent>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public static BookResource ToResource(this Book model)
|
|||
var selectedEdition = model.Editions?.Value.Where(x => x.Monitored).SingleOrDefault();
|
||||
|
||||
var title = selectedEdition?.Title ?? model.Title;
|
||||
var authorTitle = $"{model.Author.Value.Metadata.Value.SortNameLastFirst} {title}";
|
||||
var authorTitle = $"{model.Author?.Value?.Metadata?.Value?.SortNameLastFirst} {title}";
|
||||
|
||||
return new BookResource
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue