Add RSS Categories for dlvr.it Auto-hashtagging
#Redstone, #Threshold, #Threshold2 #HashtagMoreHashtagsrefactor-intermediate-models
parent
0a0b1831b6
commit
a955e33053
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue