System.Logs view can now be filtered by severity.

This commit is contained in:
Taloth Saldono
2014-02-01 23:09:22 +01:00
parent af4c351428
commit 9df0ad0bf7
7 changed files with 116 additions and 25 deletions

View File

@@ -210,18 +210,20 @@ namespace NzbDrone.Core.Datastore
public virtual PagingSpec<TModel> GetPaged(PagingSpec<TModel> pagingSpec)
{
var pagingQuery = Query.OrderBy(pagingSpec.OrderByClause(), pagingSpec.ToSortDirection())
.Skip(pagingSpec.PagingOffset())
.Take(pagingSpec.PageSize);
pagingSpec.Records = pagingQuery.ToList();
//TODO: Use the same query for count and records
pagingSpec.TotalRecords = Count();
pagingSpec.Records = GetPagedQuery(Query, pagingSpec).ToList();
pagingSpec.TotalRecords = GetPagedQuery(Query, pagingSpec).GetRowCount();
return pagingSpec;
}
protected virtual SortBuilder<TModel> GetPagedQuery(QueryBuilder<TModel> query, PagingSpec<TModel> pagingSpec)
{
return query.Where(pagingSpec.FilterExpression)
.OrderBy(pagingSpec.OrderByClause(), pagingSpec.ToSortDirection())
.Skip(pagingSpec.PagingOffset())
.Take(pagingSpec.PageSize);
}
public void DeleteAll()
{
DataMapper.Delete<TModel>(c => c.Id > 0);