mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
added /logs
This commit is contained in:
parent
fc7d4536ac
commit
9160343a51
16 changed files with 231 additions and 16 deletions
|
@ -31,6 +31,7 @@ namespace NzbDrone.Core.Datastore
|
|||
void DeleteMany(IEnumerable<int> ids);
|
||||
void SetFields(TModel model, params Expression<Func<TModel, object>>[] properties);
|
||||
TModel Single();
|
||||
PagingSpec<TModel> GetPaged(PagingSpec<TModel> pagingSpec);
|
||||
}
|
||||
|
||||
|
||||
|
@ -198,6 +199,21 @@ 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();
|
||||
|
||||
return pagingSpec;
|
||||
}
|
||||
|
||||
|
||||
private void PublishModelEvent(TModel model, RepositoryAction action)
|
||||
{
|
||||
if (PublishModelEvents)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue