Fixed a bug where reports weren't being added to history

This commit is contained in:
kay.one 2011-05-23 21:12:54 -07:00
parent f3be5fa08e
commit 500e9af6c3
18 changed files with 344 additions and 225 deletions

View file

@ -142,15 +142,14 @@ namespace NzbDrone.Web.Controllers
return View(new GridModel(episodes));
}
[GridAction]
public ActionResult _CustomBinding(GridCommand command, int seasonId)
//Local Helpers
private string GetEpisodePath(EpisodeFile file)
{
IEnumerable<Episode> data = GetData(command);
return View(new GridModel
{
Data = data,
Total = data.Count()
});
if (file == null)
return String.Empty;
//Return the path relative to the Series' Folder
return file.Path.Replace(file.Series.Path, "").Trim(Path.DirectorySeparatorChar);
}
public ActionResult SearchForSeries(string seriesName)
@ -174,66 +173,6 @@ namespace NzbDrone.Web.Controllers
return PartialView("SeriesSearchResults", model);
}
private IEnumerable<Episode> GetData(GridCommand command)
{
return null;
/*
IQueryable<Episode> data = .Orders;
//Apply filtering
if (command.FilterDescriptors.Any())
{
data = data.Where(ExpressionBuilder.Expression<Order>(command.FilterDescriptors));
}
// Apply sorting
foreach (SortDescriptor sortDescriptor in command.SortDescriptors)
{
if (sortDescriptor.SortDirection == ListSortDirection.Ascending)
{
switch (sortDescriptor.Member)
{
case "OrderID":
data = data.OrderBy(ExpressionBuilder.Expression<Order, int>(sortDescriptor.Member));
break;
case "Customer.ContactName":
data = data.OrderBy(order => order.Customer.ContactName);
break;
case "ShipAddress":
data = data.OrderBy(order => order.ShipAddress);
break;
case "OrderDate":
data = data.OrderBy(order => order.OrderDate);
break;
}
}
else
{
switch (sortDescriptor.Member)
{
case "OrderID":
data = data.OrderByDescending(order => order.OrderID);
break;
case "Customer.ContactName":
data = data.OrderByDescending(order => order.Customer.ContactName);
break;
case "ShipAddress":
data = data.OrderByDescending(order => order.ShipAddress);
break;
case "OrderDate":
data = data.OrderByDescending(order => order.OrderDate);
break;
}
}
}
count = data.Count();
// ... and paging
if (command.PageSize > 0)
{
data = data.Skip((command.Page - 1) * command.PageSize);
}
data = data.Take(command.PageSize);
return data;*/
}
[AcceptVerbs(HttpVerbs.Post)]
[GridAction]
public ActionResult _SaveAjaxEditing(string id)
@ -301,16 +240,6 @@ namespace NzbDrone.Web.Controllers
return RedirectToAction("Index");
}
//Local Helpers
private string GetEpisodePath(EpisodeFile file)
{
if (file == null)
return String.Empty;
//Return the path relative to the Series' Folder
return file.Path.Replace(file.Series.Path, "").Trim(Path.DirectorySeparatorChar);
}
private List<SeriesModel> GetSeriesModels(List<Series> seriesInDb)
{
var series = new List<SeriesModel>();