aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-03-12 22:10:43 -0400
committerLukePulverenti <luke.pulverenti@gmail.com>2013-03-12 22:10:43 -0400
commit9afd1741e0bf69cdf6c7a62679dcb70638278ab9 (patch)
tree3ec28608af5f5da6213de861d9764e7557a13da7
parent37d27ec0c3c87fdfcaab3b5ac3a299a57b9d552e (diff)
#22 - Need to strip html tags from overviews
-rw-r--r--MediaBrowser.Controller/Library/DtoBuilder.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/Library/DtoBuilder.cs b/MediaBrowser.Controller/Library/DtoBuilder.cs
index ee4ce1010..51d123280 100644
--- a/MediaBrowser.Controller/Library/DtoBuilder.cs
+++ b/MediaBrowser.Controller/Library/DtoBuilder.cs
@@ -293,14 +293,17 @@ namespace MediaBrowser.Controller.Library
dto.Name = item.Name;
dto.OfficialRating = item.OfficialRating;
+ var strippedOverview = string.IsNullOrEmpty(item.Overview) ? item.Overview : item.Overview.StripHtml();
+
if (fields.Contains(ItemFields.Overview))
{
- dto.OverviewHtml = string.IsNullOrEmpty(item.Overview) ? item.Overview : item.Overview.StripHtml();
+ dto.Overview = strippedOverview;
}
- if (fields.Contains(ItemFields.OverviewHtml))
+ // Only supply the html version if there was actually html content
+ if (fields.Contains(ItemFields.OverviewHtml) && !string.Equals(item.Overview, strippedOverview))
{
- dto.Overview = item.Overview;
+ dto.OverviewHtml = item.Overview;
}
// If there are no backdrops, indicate what parent has them in case the Ui wants to allow inheritance