only show beer if one has been checked in over the last 4 hours
This commit is contained in:
@@ -14,7 +14,7 @@ namespace AboutMe.Mvc.Web.Controllers
|
|||||||
{
|
{
|
||||||
public class HomeController : Controller
|
public class HomeController : Controller
|
||||||
{
|
{
|
||||||
[OutputCache(Duration = 900)]
|
[OutputCache(Duration = 720)]
|
||||||
public async Task<ActionResult> Index()
|
public async Task<ActionResult> Index()
|
||||||
{
|
{
|
||||||
var currentBeer = string.Empty;
|
var currentBeer = string.Empty;
|
||||||
@@ -23,7 +23,7 @@ namespace AboutMe.Mvc.Web.Controllers
|
|||||||
var req = new UnAuthenticatedUntappdCredentials(ConfigurationManager.AppSettings["untappdkey"],
|
var req = new UnAuthenticatedUntappdCredentials(ConfigurationManager.AppSettings["untappdkey"],
|
||||||
ConfigurationManager.AppSettings["untappdsecret"]);
|
ConfigurationManager.AppSettings["untappdsecret"]);
|
||||||
var response = await new Repository().GetAsync<UserActivityFeed>(req, "tparnell");
|
var response = await new Repository().GetAsync<UserActivityFeed>(req, "tparnell");
|
||||||
currentBeer = response.Response.Checkins.Items[0].Beer.BeerName;
|
currentBeer = response.Response.Checkins.Items.First(a => DateTime.Parse(a.CreatedAt) > DateTime.Now.AddHours(-4)).Beer.BeerName;
|
||||||
}
|
}
|
||||||
catch(Exception)
|
catch(Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user