mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fixes #379 - artist images don't show on web interface
This commit is contained in:
parent
f064d6c9c7
commit
ab70effd5e
@ -56,14 +56,28 @@ namespace MediaBrowser.Providers.Music
|
|||||||
|
|
||||||
if (musicArtist != null)
|
if (musicArtist != null)
|
||||||
{
|
{
|
||||||
artist.Images = new Dictionary<ImageType, string>(musicArtist.Images);
|
MergeImages(musicArtist.Images, artist.Images);
|
||||||
|
|
||||||
|
// Merge backdrops
|
||||||
|
var backdrops = musicArtist.BackdropImagePaths.ToList();
|
||||||
|
backdrops.InsertRange(0, artist.BackdropImagePaths);
|
||||||
|
artist.BackdropImagePaths = backdrops.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (!artist.LockedFields.Contains(MetadataFields.Genres))
|
||||||
|
{
|
||||||
|
// Merge genres
|
||||||
|
var genres = musicArtist.Genres.ToList();
|
||||||
|
genres.InsertRange(0, artist.Genres);
|
||||||
|
artist.Genres = genres.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
artist.BackdropImagePaths = musicArtist.BackdropImagePaths.ToList();
|
|
||||||
artist.ScreenshotImagePaths = musicArtist.ScreenshotImagePaths.ToList();
|
|
||||||
artist.SetProviderId(MetadataProviders.Musicbrainz, musicArtist.GetProviderId(MetadataProviders.Musicbrainz));
|
|
||||||
artist.Genres = musicArtist.Genres.ToList();
|
artist.Genres = musicArtist.Genres.ToList();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (!artist.LockedFields.Contains(MetadataFields.Genres))
|
||||||
{
|
{
|
||||||
// Avoid implicitly captured closure
|
// Avoid implicitly captured closure
|
||||||
var artist1 = artist;
|
var artist1 = artist;
|
||||||
@ -73,6 +87,7 @@ namespace MediaBrowser.Providers.Music
|
|||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
numComplete++;
|
numComplete++;
|
||||||
double percent = numComplete;
|
double percent = numComplete;
|
||||||
@ -89,6 +104,21 @@ namespace MediaBrowser.Providers.Music
|
|||||||
await _libraryManager.ValidateArtists(cancellationToken, innerProgress).ConfigureAwait(false);
|
await _libraryManager.ValidateArtists(cancellationToken, innerProgress).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void MergeImages(Dictionary<ImageType, string> source, Dictionary<ImageType, string> target)
|
||||||
|
{
|
||||||
|
foreach (var key in source.Keys
|
||||||
|
.ToList()
|
||||||
|
.Where(k => !target.ContainsKey(k)))
|
||||||
|
{
|
||||||
|
string path;
|
||||||
|
|
||||||
|
if (source.TryGetValue(key, out path))
|
||||||
|
{
|
||||||
|
target[key] = path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all artists.
|
/// Gets all artists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -40,7 +40,6 @@ namespace MediaBrowser.Providers.Music
|
|||||||
target.Tags = source.Tags.ToList();
|
target.Tags = source.Tags.ToList();
|
||||||
target.Overview = source.Overview;
|
target.Overview = source.Overview;
|
||||||
target.ProductionLocations = source.ProductionLocations.ToList();
|
target.ProductionLocations = source.ProductionLocations.ToList();
|
||||||
target.Genres = source.Genres.ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ProcessAlbumData(BaseItem item, LastfmAlbum data)
|
public static void ProcessAlbumData(BaseItem item, LastfmAlbum data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user