diff --git a/PlexRequests.UI/Content/search.js b/PlexRequests.UI/Content/search.js index c2d43ee17..1096290ed 100644 --- a/PlexRequests.UI/Content/search.js +++ b/PlexRequests.UI/Content/search.js @@ -244,6 +244,7 @@ $(function () { var html = musicTemplate(context); $("#musicList").append(html); + getCoverArt(context.id); }); } else { @@ -253,6 +254,14 @@ $(function () { }); }; + function getCoverArt(artistId) { + $.ajax("/search/music/coverart/" + artistId).success(function (result) { + if (result) { + $('#' + artistId + "imageDiv").html(" poster"); + } + }); + }; + function buildMovieContext(result) { var date = new Date(result.releaseDate); var year = date.getFullYear(); diff --git a/PlexRequests.UI/Modules/SearchModule.cs b/PlexRequests.UI/Modules/SearchModule.cs index 9bd841777..c77fddbbd 100644 --- a/PlexRequests.UI/Modules/SearchModule.cs +++ b/PlexRequests.UI/Modules/SearchModule.cs @@ -80,6 +80,7 @@ namespace PlexRequests.UI.Modules Get["movie/{searchTerm}"] = parameters => SearchMovie((string)parameters.searchTerm); Get["tv/{searchTerm}"] = parameters => SearchTvShow((string)parameters.searchTerm); Get["music/{searchTerm}"] = parameters => SearchMusic((string)parameters.searchTerm); + Get["music/coverArt/{id}"] = p => GetMusicBrainzCoverArt((string)p.id); Get["movie/upcoming"] = parameters => UpcomingMovies(); Get["movie/playing"] = parameters => CurrentlyPlayingMovies(); @@ -168,7 +169,6 @@ namespace PlexRequests.UI.Modules var model = new List(); foreach (var a in releases) { - var img = GetMusicBrainzCoverArt(a.id); model.Add(new SearchMusicViewModel { Title = a.title, @@ -177,7 +177,6 @@ namespace PlexRequests.UI.Modules Overview = a.disambiguation, ReleaseDate = a.date, TrackCount = a.TrackCount, - CoverArtUrl = img, ReleaseType = a.status, Country = a.country }); diff --git a/PlexRequests.UI/Views/Search/Index.cshtml b/PlexRequests.UI/Views/Search/Index.cshtml index 25aecb821..e5c316a79 100644 --- a/PlexRequests.UI/Views/Search/Index.cshtml +++ b/PlexRequests.UI/Views/Search/Index.cshtml @@ -159,9 +159,9 @@