From 0ffef05cc398f8556507129e177ff62de6cfb089 Mon Sep 17 00:00:00 2001
From: Deluan <deluan@navidrome.org>
Date: Fri, 13 Jan 2023 14:47:18 -0500
Subject: [PATCH] Remove "Biography not available" when agents are not
 available

---
 core/agents/agents_test.go | 6 ++----
 core/agents/local_agent.go | 8 --------
 scanner/refresher.go       | 4 ++++
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/core/agents/agents_test.go b/core/agents/agents_test.go
index 5975fb41f..86c7a4836 100644
--- a/core/agents/agents_test.go
+++ b/core/agents/agents_test.go
@@ -30,9 +30,6 @@ var _ = Describe("Agents", func() {
 			ag = New(ds)
 		})
 
-		It("calls the placeholder GetBiography", func() {
-			Expect(ag.GetBiography(ctx, "123", "John Doe", "mb123")).To(Equal(localBiography))
-		})
 		It("calls the placeholder GetImages", func() {
 			mfRepo.SetData(model.MediaFiles{{ID: "1", Title: "One", MbzReleaseTrackID: "111"}, {ID: "2", Title: "Two", MbzReleaseTrackID: "222"}})
 			songs, err := ag.GetTopSongs(ctx, "123", "John Doe", "mb123", 2)
@@ -104,7 +101,8 @@ var _ = Describe("Agents", func() {
 			})
 			It("skips the agent if it returns an error", func() {
 				mock.Err = errors.New("error")
-				Expect(ag.GetBiography(ctx, "123", "test", "mb123")).To(Equal(localBiography))
+				_, err := ag.GetBiography(ctx, "123", "test", "mb123")
+				Expect(err).To(MatchError(ErrNotFound))
 				Expect(mock.Args).To(ConsistOf("123", "test", "mb123"))
 			})
 			It("interrupts if the context is canceled", func() {
diff --git a/core/agents/local_agent.go b/core/agents/local_agent.go
index 2727c4962..05d0fb3db 100644
--- a/core/agents/local_agent.go
+++ b/core/agents/local_agent.go
@@ -9,10 +9,6 @@ import (
 
 const LocalAgentName = "local"
 
-const (
-	localBiography = "Biography not available"
-)
-
 type localAgent struct {
 	ds model.DataStore
 }
@@ -25,10 +21,6 @@ func (p *localAgent) AgentName() string {
 	return LocalAgentName
 }
 
-func (p *localAgent) GetBiography(ctx context.Context, id, name, mbid string) (string, error) {
-	return localBiography, nil
-}
-
 func (p *localAgent) GetTopSongs(ctx context.Context, id, artistName, mbid string, count int) ([]Song, error) {
 	top, err := p.ds.MediaFile(ctx).GetAll(model.QueryOptions{
 		Sort:  "playCount",
diff --git a/scanner/refresher.go b/scanner/refresher.go
index f3c9d300e..c66984882 100644
--- a/scanner/refresher.go
+++ b/scanner/refresher.go
@@ -139,6 +139,10 @@ func (r *refresher) refreshArtists(ctx context.Context, ids ...string) error {
 	grouped := slice.Group(albums, func(al model.Album) string { return al.AlbumArtistID })
 	for _, group := range grouped {
 		a := model.Albums(group).ToAlbumArtist()
+
+		// Force a external metadata lookup on next access
+		a.ExternalInfoUpdatedAt = time.Time{}
+
 		err := repo.Put(&a)
 		if err != nil {
 			return err