sync updates

pull/702/head
Luke Pulverenti 10 years ago
parent 55a726cdef
commit 800a16a213

@ -92,6 +92,11 @@ namespace MediaBrowser.Api.Sync
public string TargetId { get; set; }
}
[Route("/Sync/Data", "POST", Summary = "Syncs data between device and server")]
public class SyncData : SyncDataRequest, IReturn<SyncDataResponse>
{
}
[Authenticated]
public class SyncService : BaseApiService
{
@ -219,5 +224,12 @@ namespace MediaBrowser.Api.Sync
{
return ToOptimizedResult(_syncManager.GetReadySyncItems(request.TargetId));
}
public async Task<object> Post(SyncData request)
{
var response = await _syncManager.SyncData(request).ConfigureAwait(false);
return ToOptimizedResult(response);
}
}
}

@ -95,5 +95,12 @@ namespace MediaBrowser.Controller.Sync
/// <param name="targetId">The target identifier.</param>
/// <returns>List&lt;SyncedItem&gt;.</returns>
List<SyncedItem> GetReadySyncItems(string targetId);
/// <summary>
/// Synchronizes the data.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>Task&lt;SyncDataResponse&gt;.</returns>
Task<SyncDataResponse> SyncData(SyncDataRequest request);
}
}

@ -1055,6 +1055,12 @@
<Compile Include="..\MediaBrowser.Model\Sync\SyncCategory.cs">
<Link>Sync\SyncCategory.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncDataRequest.cs">
<Link>Sync\SyncDataRequest.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncDataResponse.cs">
<Link>Sync\SyncDataResponse.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncDialogOptions.cs">
<Link>Sync\SyncDialogOptions.cs</Link>
</Compile>

@ -1014,6 +1014,12 @@
<Compile Include="..\MediaBrowser.Model\Sync\SyncCategory.cs">
<Link>Sync\SyncCategory.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncDataRequest.cs">
<Link>Sync\SyncDataRequest.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncDataResponse.cs">
<Link>Sync\SyncDataResponse.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.Model\Sync\SyncDialogOptions.cs">
<Link>Sync\SyncDialogOptions.cs</Link>
</Compile>

@ -1433,5 +1433,12 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="targetId">The target identifier.</param>
/// <returns>List&lt;SyncedItem&gt;.</returns>
Task<List<SyncedItem>> GetReadySyncItems(string targetId);
/// <summary>
/// Synchronizes the data.
/// </summary>
/// <param name="request">The request.</param>
/// <returns>Task&lt;SyncDataResponse&gt;.</returns>
Task<SyncDataResponse> SyncData(SyncDataRequest request);
}
}

@ -372,6 +372,8 @@
<Compile Include="Sync\ItemFileType.cs" />
<Compile Include="Sync\LocalItem.cs" />
<Compile Include="Sync\SyncCategory.cs" />
<Compile Include="Sync\SyncDataRequest.cs" />
<Compile Include="Sync\SyncDataResponse.cs" />
<Compile Include="Sync\SyncDialogOptions.cs" />
<Compile Include="Sync\SyncedItem.cs" />
<Compile Include="Sync\SyncHelper.cs" />

@ -3,7 +3,7 @@ namespace MediaBrowser.Model.Sync
{
public class DeviceFileInfo
{
public string[] Path { get; set; }
public string Path { get; set; }
public string Name { get; set; }
}
}

@ -18,7 +18,7 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the path.
/// </summary>
/// <value>The path.</value>
public string[] Path { get; set; }
public string Path { get; set; }
/// <summary>
/// Gets or sets the type of the image.
/// </summary>

@ -13,7 +13,7 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the local path.
/// </summary>
/// <value>The local path.</value>
public string[] LocalPath { get; set; }
public string LocalPath { get; set; }
/// <summary>
/// Gets or sets the server identifier.
/// </summary>

@ -0,0 +1,16 @@
using System.Collections.Generic;
namespace MediaBrowser.Model.Sync
{
public class SyncDataRequest
{
public List<string> LocalItemIds { get; set; }
public string TargetId { get; set; }
public SyncDataRequest()
{
LocalItemIds = new List<string>();
}
}
}

@ -0,0 +1,14 @@
using System.Collections.Generic;
namespace MediaBrowser.Model.Sync
{
public class SyncDataResponse
{
public List<string> ItemIdsToRemove { get; set; }
public SyncDataResponse()
{
ItemIdsToRemove = new List<string>();
}
}
}

@ -388,5 +388,12 @@ namespace MediaBrowser.Server.Implementations.Sync
return jobItemResult.Items.Select(GetJobItemInfo)
.ToList();
}
public async Task<SyncDataResponse> SyncData(SyncDataRequest request)
{
var response = new SyncDataResponse();
return response;
}
}
}

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
<version>3.0.534</version>
<version>3.0.537</version>
<title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<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>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.534" />
<dependency id="MediaBrowser.Common" version="3.0.537" />
<dependency id="NLog" version="3.1.0.0" />
<dependency id="SimpleInjector" version="2.6.1" />
<dependency id="sharpcompress" version="0.10.2" />

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

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

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

Loading…
Cancel
Save