cloud sync progress

This commit is contained in:
Luke Pulverenti
2015-02-22 14:05:38 -05:00
parent 20ceca1479
commit 084df0a20e
4 changed files with 39 additions and 11 deletions

View File

@@ -34,6 +34,11 @@ namespace MediaBrowser.Server.Implementations.Sync
get { return "Cloud Sync"; }
}
private ICloudSyncProvider GetProvider(SyncTarget target)
{
return null;
}
public Task<List<string>> GetServerItemIds(string serverId, SyncTarget target, CancellationToken cancellationToken)
{
throw new NotImplementedException();
@@ -44,9 +49,11 @@ namespace MediaBrowser.Server.Implementations.Sync
throw new NotImplementedException();
}
public Task TransferItemFile(string serverId, string itemId, string[] pathParts, string name, ItemFileType fileType, SyncTarget target, CancellationToken cancellationToken)
public Task TransferItemFile(string serverId, string itemId, string inputFile, string[] pathParts, SyncTarget target, CancellationToken cancellationToken)
{
throw new NotImplementedException();
var provider = GetProvider(target);
return provider.TransferItemFile(serverId, itemId, inputFile, pathParts, target, cancellationToken);
}
}
}

View File

@@ -1,6 +1,7 @@
using MediaBrowser.Common.Progress;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Sync;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Sync;
using System;
@@ -29,10 +30,6 @@ namespace MediaBrowser.Server.Implementations.Sync
{
var serverId = _appHost.SystemId;
await SyncData(provider, serverId, target, cancellationToken).ConfigureAwait(false);
progress.Report(2);
// Do the data sync twice so the server knows what was removed from the device
await SyncData(provider, serverId, target, cancellationToken).ConfigureAwait(false);
progress.Report(3);
@@ -44,6 +41,10 @@ namespace MediaBrowser.Server.Implementations.Sync
progress.Report(totalProgress);
});
await GetNewMedia(provider, target, serverId, innerProgress, cancellationToken);
// Do the data sync twice so the server knows what was removed from the device
await SyncData(provider, serverId, target, cancellationToken).ConfigureAwait(false);
progress.Report(100);
}
@@ -135,8 +136,10 @@ namespace MediaBrowser.Server.Implementations.Sync
try
{
//await provider.TransferItemFile(serverId, libraryItem.Id, internalSyncJobItem.OutputPath, target, cancellationToken)
// .ConfigureAwait(false);
string[] pathParts = GetPathParts(serverId, libraryItem);
await provider.TransferItemFile(serverId, libraryItem.Id, internalSyncJobItem.OutputPath, pathParts, target, cancellationToken)
.ConfigureAwait(false);
progress.Report(92);
@@ -170,5 +173,10 @@ namespace MediaBrowser.Server.Implementations.Sync
{
return provider.DeleteItem(serverId, itemId, target, cancellationToken);
}
private string[] GetPathParts(string serverId, BaseItemDto item)
{
return null;
}
}
}