@ -114,7 +114,12 @@ namespace NzbDrone.Core.AuthorStats
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 @@ namespace Readarr.Api.V1.Books
IHandle<BookGrabbedEvent>,
IHandle<BookEditedEvent>,
IHandle<BookUpdatedEvent>,
IHandle<BookDeletedEvent>,
IHandle<BookImportedEvent>,
IHandle<TrackImportedEvent>,
IHandle<BookFileDeletedEvent>
@ -52,7 +52,7 @@ namespace Readarr.Api.V1.Books
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