From 8051ea9b1bebcccfa1471c1a3db0e03fd7a70bcd Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 15 Feb 2015 19:33:06 -0500 Subject: update javascript connection manager to latest feature set --- MediaBrowser.Model/ApiClient/NetworkStatus.cs | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 MediaBrowser.Model/ApiClient/NetworkStatus.cs (limited to 'MediaBrowser.Model/ApiClient') diff --git a/MediaBrowser.Model/ApiClient/NetworkStatus.cs b/MediaBrowser.Model/ApiClient/NetworkStatus.cs new file mode 100644 index 000000000..715087607 --- /dev/null +++ b/MediaBrowser.Model/ApiClient/NetworkStatus.cs @@ -0,0 +1,30 @@ + +namespace MediaBrowser.Model.ApiClient +{ + public class NetworkStatus + { + /// + /// Gets or sets a value indicating whether this instance is network available. + /// + /// true if this instance is network available; otherwise, false. + public bool IsNetworkAvailable { get; set; } + /// + /// Gets or sets a value indicating whether this instance is local network available. + /// + /// null if [is local network available] contains no value, true if [is local network available]; otherwise, false. + public bool? IsLocalNetworkAvailable { get; set; } + /// + /// Gets the is any local network available. + /// + /// true if XXXX, false otherwise. + public bool GetIsAnyLocalNetworkAvailable() + { + if (!IsLocalNetworkAvailable.HasValue) + { + return IsNetworkAvailable; + } + + return IsLocalNetworkAvailable.Value; + } + } +} -- cgit v1.2.3 From 8497c2926f0ed44423f16479a4a234e36f200b68 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 18 Feb 2015 00:01:13 -0500 Subject: fix episode paging --- MediaBrowser.Api/TvShowsService.cs | 7 ++++--- MediaBrowser.Model/ApiClient/IConnectionManager.cs | 7 +++++++ MediaBrowser.Server.Implementations/Sync/SyncManager.cs | 13 ++++++++++--- Nuget/MediaBrowser.Common.Internal.nuspec | 8 ++++---- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Model.Signed.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 ++-- 7 files changed, 29 insertions(+), 14 deletions(-) (limited to 'MediaBrowser.Model/ApiClient') diff --git a/MediaBrowser.Api/TvShowsService.cs b/MediaBrowser.Api/TvShowsService.cs index 121ef1ce6..9c9feead5 100644 --- a/MediaBrowser.Api/TvShowsService.cs +++ b/MediaBrowser.Api/TvShowsService.cs @@ -491,9 +491,10 @@ namespace MediaBrowser.Api 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); @@ -502,7 +503,7 @@ namespace MediaBrowser.Api return new ItemsResult { - TotalRecordCount = dtos.Length, + TotalRecordCount = returnList.Count, Items = dtos }; } diff --git a/MediaBrowser.Model/ApiClient/IConnectionManager.cs b/MediaBrowser.Model/ApiClient/IConnectionManager.cs index 658c71ac5..341df2728 100644 --- a/MediaBrowser.Model/ApiClient/IConnectionManager.cs +++ b/MediaBrowser.Model/ApiClient/IConnectionManager.cs @@ -54,6 +54,13 @@ namespace MediaBrowser.Model.ApiClient /// IApiClient. IApiClient GetApiClient(IHasServerId item); + /// + /// Gets the API client. + /// + /// The server identifier. + /// IApiClient. + IApiClient GetApiClient(string serverId); + /// /// Connects the specified cancellation token. /// diff --git a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs index be6034e08..fc3d54150 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs +++ b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs @@ -135,10 +135,17 @@ namespace MediaBrowser.Server.Implementations.Sync ParentId = request.ParentId }; - // It's just a static list - if (!items.Any(i => i.IsFolder || i is IItemByName)) + if (!request.Category.HasValue && request.ItemIds != null) { - 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); diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 8d1ffe32f..e1b24cd09 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.571 + 3.0.574 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,9 +12,9 @@ Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption. Copyright © Media Browser 2013 - - - + + + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 4fc02c000..b98be398d 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.571 + 3.0.574 MediaBrowser.Common Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Model.Signed.nuspec b/Nuget/MediaBrowser.Model.Signed.nuspec index b2bbdb8d2..af0799cb4 100644 --- a/Nuget/MediaBrowser.Model.Signed.nuspec +++ b/Nuget/MediaBrowser.Model.Signed.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Model.Signed - 3.0.571 + 3.0.574 MediaBrowser.Model - Signed Edition Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 1c58f100a..084c760e9 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.571 + 3.0.574 Media Browser.Server.Core Media Browser Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Media Browser Server. Copyright © Media Browser 2013 - + -- cgit v1.2.3