Add RSS Categories for dlvr.it Auto-hashtagging

#Redstone, #Threshold, #Threshold2

#HashtagMoreHashtags
refactor-intermediate-models
Thomas Hounsell 2015-12-14 11:01:29 +00:00
parent 0a0b1831b6
commit a955e33053
1 changed files with 19 additions and 0 deletions

View File

@ -80,6 +80,7 @@ namespace BuildFeed.Controllers
IsPermaLink = true,
Value = $"{Request.Url.Scheme}://{Request.Url.Authority}{Url.Action("viewBuild", new { controller = "front", id = build.Id })}"
},
Category = GetCategoryForBuild(build),
InternalPubDate = new RssDate(build.Added).DateStringISO8601 // bit of a dirty hack to work around problem in X.Web.RSS with the date format.
}).ToList()
}
@ -243,5 +244,23 @@ namespace BuildFeed.Controllers
return new EmptyResult();
}
private static RssCategory GetCategoryForBuild(BuildModel b)
{
if(b.Number >= 11000)
{
return new RssCategory() { Text = "Redstone" };
}
else if(b.Number >= 10500)
{
return new RssCategory() { Text = "Threshold2" };
}
else if (b.Number >= 9700)
{
return new RssCategory() { Text = "Threshold" };
}
return null;
}
}
}