Ensure correct icon for file types in search results
This commit is contained in:
committed by
Sebastiaan Janssen
parent
297e054381
commit
531dee1e75
@@ -384,19 +384,7 @@ namespace Umbraco.Web.Search
|
|||||||
/// <param name="results"></param>
|
/// <param name="results"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private IEnumerable<SearchResultEntity> MediaFromSearchResults(IEnumerable<ISearchResult> results)
|
private IEnumerable<SearchResultEntity> MediaFromSearchResults(IEnumerable<ISearchResult> results)
|
||||||
{
|
=> _mapper.Map<IEnumerable<SearchResultEntity>>(results);
|
||||||
//add additional data
|
|
||||||
foreach (var result in results)
|
|
||||||
{
|
|
||||||
var m = _mapper.Map<SearchResultEntity>(result);
|
|
||||||
//if no icon could be mapped, it will be set to document, so change it to picture
|
|
||||||
if (m.Icon == Constants.Icons.DefaultIcon)
|
|
||||||
{
|
|
||||||
m.Icon = Constants.Icons.MediaImage;
|
|
||||||
}
|
|
||||||
yield return m;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a collection of entities for content based on search results
|
/// Returns a collection of entities for content based on search results
|
||||||
|
|||||||
Reference in New Issue
Block a user