From 13274348e9e2162eca84dc8f20c4d80ade29e8bf Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 17 Dec 2014 00:30:31 -0500 Subject: sync updates --- MediaBrowser.Common.Implementations/Security/MbAdmin.cs | 13 +++++++++++++ .../Security/PluginSecurityManager.cs | 6 ++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 MediaBrowser.Common.Implementations/Security/MbAdmin.cs (limited to 'MediaBrowser.Common.Implementations/Security') diff --git a/MediaBrowser.Common.Implementations/Security/MbAdmin.cs b/MediaBrowser.Common.Implementations/Security/MbAdmin.cs new file mode 100644 index 000000000..9171e9e13 --- /dev/null +++ b/MediaBrowser.Common.Implementations/Security/MbAdmin.cs @@ -0,0 +1,13 @@ + +namespace MediaBrowser.Common.Implementations.Security +{ + public class MbAdmin + { + public const string HttpUrl = "https://www.mb3admin.com/admin/"; + + /// + /// Leaving as http for now until we get it squared away + /// + public const string HttpsUrl = "http://www.mb3admin.com/admin/"; + } +} diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs index dfdf61016..3e81e839f 100644 --- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs +++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs @@ -17,9 +17,7 @@ namespace MediaBrowser.Common.Implementations.Security /// public class PluginSecurityManager : ISecurityManager { - private const string MbAdminUrl = "https://www.mb3admin.com/admin/"; - - private const string MBValidateUrl = MbAdminUrl + "service/registration/validate"; + private const string MBValidateUrl = MbAdmin.HttpsUrl + "service/registration/validate"; /// /// The _is MB supporter @@ -162,7 +160,7 @@ namespace MediaBrowser.Common.Implementations.Security return new SupporterInfo(); } - var url = MbAdminUrl + "/service/supporter/retrieve?key=" + key; + var url = MbAdmin.HttpsUrl + "/service/supporter/retrieve?key=" + key; using (var stream = await _httpClient.Get(url, CancellationToken.None).ConfigureAwait(false)) { -- cgit v1.2.3 From 3763f7d912cd38740d053d677d064a480fba6d23 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 17 Dec 2014 00:52:34 -0500 Subject: resolve update check errors --- MediaBrowser.Api/Sync/SyncService.cs | 33 +++++++++------------- .../Security/MbAdmin.cs | 2 +- MediaBrowser.Controller/Sync/ISyncManager.cs | 7 +++++ MediaBrowser.Model/ApiClient/IApiClient.cs | 3 +- .../Sync/SyncManager.cs | 5 ++++ 5 files changed, 29 insertions(+), 21 deletions(-) (limited to 'MediaBrowser.Common.Implementations/Security') diff --git a/MediaBrowser.Api/Sync/SyncService.cs b/MediaBrowser.Api/Sync/SyncService.cs index d4d1106ec..cefb0e46e 100644 --- a/MediaBrowser.Api/Sync/SyncService.cs +++ b/MediaBrowser.Api/Sync/SyncService.cs @@ -27,22 +27,14 @@ namespace MediaBrowser.Api.Sync public string Id { get; set; } } + [Route("/Sync/JobItems", "GET", Summary = "Gets sync job items.")] + public class GetSyncJobItems : SyncJobItemQuery, IReturn> + { + } + [Route("/Sync/Jobs", "GET", Summary = "Gets sync jobs.")] - public class GetSyncJobs : IReturn> + public class GetSyncJobs : SyncJobQuery, IReturn> { - /// - /// Skips over a given number of items within the results. Use for paging. - /// - /// The start index. - [ApiMember(Name = "StartIndex", Description = "Optional. The record index to start at. All items with a lower index will be dropped from the results.", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] - public int? StartIndex { get; set; } - - /// - /// The maximum number of items to return - /// - /// The limit. - [ApiMember(Name = "Limit", Description = "Optional. The maximum number of records to return", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] - public int? Limit { get; set; } } [Route("/Sync/Jobs", "POST", Summary = "Gets sync jobs.")] @@ -104,11 +96,14 @@ namespace MediaBrowser.Api.Sync public object Get(GetSyncJobs request) { - var result = _syncManager.GetJobs(new SyncJobQuery - { - StartIndex = request.StartIndex, - Limit = request.Limit - }); + var result = _syncManager.GetJobs(request); + + return ToOptimizedResult(result); + } + + public object Get(GetSyncJobItems request) + { + var result = _syncManager.GetJobItems(request); return ToOptimizedResult(result); } diff --git a/MediaBrowser.Common.Implementations/Security/MbAdmin.cs b/MediaBrowser.Common.Implementations/Security/MbAdmin.cs index 9171e9e13..ab4a83257 100644 --- a/MediaBrowser.Common.Implementations/Security/MbAdmin.cs +++ b/MediaBrowser.Common.Implementations/Security/MbAdmin.cs @@ -3,7 +3,7 @@ namespace MediaBrowser.Common.Implementations.Security { public class MbAdmin { - public const string HttpUrl = "https://www.mb3admin.com/admin/"; + public const string HttpUrl = "http://www.mb3admin.com/admin/"; /// /// Leaving as http for now until we get it squared away diff --git a/MediaBrowser.Controller/Sync/ISyncManager.cs b/MediaBrowser.Controller/Sync/ISyncManager.cs index 5814daf2d..47339f677 100644 --- a/MediaBrowser.Controller/Sync/ISyncManager.cs +++ b/MediaBrowser.Controller/Sync/ISyncManager.cs @@ -22,6 +22,13 @@ namespace MediaBrowser.Controller.Sync /// QueryResult<SyncJob>. QueryResult GetJobs(SyncJobQuery query); + /// + /// Gets the job items. + /// + /// The query. + /// QueryResult<SyncJobItem>. + QueryResult GetJobItems(SyncJobItemQuery query); + /// /// Gets the job. /// diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index 5560e19ac..9521f8538 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -1411,8 +1411,9 @@ namespace MediaBrowser.Model.ApiClient /// Gets the synchronize job item file. /// /// The identifier. + /// The cancellation token. /// Task<Stream>. - Task GetSyncJobItemFile(string id); + Task GetSyncJobItemFile(string id, CancellationToken cancellationToken); /// /// Opens the web socket. diff --git a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs index 6043e8344..5c699f010 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs +++ b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs @@ -284,5 +284,10 @@ namespace MediaBrowser.Server.Implementations.Sync { return _repo.GetJobItem(id); } + + public QueryResult GetJobItems(SyncJobItemQuery query) + { + return _repo.GetJobItems(query); + } } } -- cgit v1.2.3