fix episode paging

This commit is contained in:
Luke Pulverenti 2015-02-18 00:01:13 -05:00
parent a6ebf8b7b9
commit 8497c2926f
7 changed files with 29 additions and 14 deletions

View File

@ -491,9 +491,10 @@ namespace MediaBrowser.Api
returnItems = UserViewBuilder.FilterForAdjacency(returnItems, request.AdjacentTo); returnItems = UserViewBuilder.FilterForAdjacency(returnItems, request.AdjacentTo);
} }
returnItems = _libraryManager.ReplaceVideosWithPrimaryVersions(returnItems); var returnList = _libraryManager.ReplaceVideosWithPrimaryVersions(returnItems)
.ToList();
var pagedItems = ApplyPaging(returnItems, request.StartIndex, request.Limit); var pagedItems = ApplyPaging(returnList, request.StartIndex, request.Limit);
var dtoOptions = GetDtoOptions(request); var dtoOptions = GetDtoOptions(request);
@ -502,7 +503,7 @@ namespace MediaBrowser.Api
return new ItemsResult return new ItemsResult
{ {
TotalRecordCount = dtos.Length, TotalRecordCount = returnList.Count,
Items = dtos Items = dtos
}; };
} }

View File

@ -54,6 +54,13 @@ namespace MediaBrowser.Model.ApiClient
/// <returns>IApiClient.</returns> /// <returns>IApiClient.</returns>
IApiClient GetApiClient(IHasServerId item); IApiClient GetApiClient(IHasServerId item);
/// <summary>
/// Gets the API client.
/// </summary>
/// <param name="serverId">The server identifier.</param>
/// <returns>IApiClient.</returns>
IApiClient GetApiClient(string serverId);
/// <summary> /// <summary>
/// Connects the specified cancellation token. /// Connects the specified cancellation token.
/// </summary> /// </summary>

View File

@ -135,10 +135,17 @@ namespace MediaBrowser.Server.Implementations.Sync
ParentId = request.ParentId ParentId = request.ParentId
}; };
// It's just a static list if (!request.Category.HasValue && request.ItemIds != null)
if (!items.Any(i => i.IsFolder || i is IItemByName))
{ {
job.SyncNewContent = false; var requestedItems = request.ItemIds
.Select(_libraryManager.GetItemById)
.Where(i => i != null);
// It's just a static list
if (!requestedItems.Any(i => i.IsFolder || i is IItemByName))
{
job.SyncNewContent = false;
}
} }
await _repo.Create(job).ConfigureAwait(false); await _repo.Create(job).ConfigureAwait(false);

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.571</version> <version>3.0.574</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,9 +12,9 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.571" /> <dependency id="MediaBrowser.Common" version="3.0.574" />
<dependency id="NLog" version="3.1.0.0" /> <dependency id="NLog" version="3.2.0.0" />
<dependency id="SimpleInjector" version="2.6.1" /> <dependency id="SimpleInjector" version="2.7.0" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.571</version> <version>3.0.574</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Model.Signed</id> <id>MediaBrowser.Model.Signed</id>
<version>3.0.571</version> <version>3.0.574</version>
<title>MediaBrowser.Model - Signed Edition</title> <title>MediaBrowser.Model - Signed Edition</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.571</version> <version>3.0.574</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.571" /> <dependency id="MediaBrowser.Common" version="3.0.574" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>