From bda0b2f7c490fbd2f462902aba13ee7db80688c3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 28 Mar 2015 01:07:29 -0400 Subject: [PATCH] sync updates --- .../MediaBrowser.Controller.csproj | 4 ++-- ...equiresDynamicAccess.cs => IHasDynamicAccess.cs} | 8 ++++---- MediaBrowser.Controller/Sync/IServerSyncProvider.cs | 2 +- .../Sync/{SendFileResult.cs => SyncedFileInfo.cs} | 13 ++++++++++++- .../Sync/MediaSync.cs | 2 +- .../Sync/SyncedMediaSourceProvider.cs | 6 +++--- Nuget/MediaBrowser.Common.Internal.nuspec | 4 ++-- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Model.Signed.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 ++-- 10 files changed, 29 insertions(+), 18 deletions(-) rename MediaBrowser.Controller/Sync/{IRequiresDynamicAccess.cs => IHasDynamicAccess.cs} (58%) rename MediaBrowser.Controller/Sync/{SendFileResult.cs => SyncedFileInfo.cs} (50%) diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 809d1f6f4..2fa62f79f 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -393,13 +393,13 @@ - + - + diff --git a/MediaBrowser.Controller/Sync/IRequiresDynamicAccess.cs b/MediaBrowser.Controller/Sync/IHasDynamicAccess.cs similarity index 58% rename from MediaBrowser.Controller/Sync/IRequiresDynamicAccess.cs rename to MediaBrowser.Controller/Sync/IHasDynamicAccess.cs index 820a1dce0..f907de729 100644 --- a/MediaBrowser.Controller/Sync/IRequiresDynamicAccess.cs +++ b/MediaBrowser.Controller/Sync/IHasDynamicAccess.cs @@ -4,15 +4,15 @@ using System.Threading.Tasks; namespace MediaBrowser.Controller.Sync { - public interface IRequiresDynamicAccess + public interface IHasDynamicAccess { /// - /// Gets the file information. + /// Gets the synced file information. /// /// The remote path. /// The target. /// The cancellation token. - /// Task<SendFileResult>. - Task GetFileInfo(string remotePath, SyncTarget target, CancellationToken cancellationToken); + /// Task<SyncedFileInfo>. + Task GetSyncedFileInfo(string remotePath, SyncTarget target, CancellationToken cancellationToken); } } diff --git a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs b/MediaBrowser.Controller/Sync/IServerSyncProvider.cs index 9cccd4150..46bbbd329 100644 --- a/MediaBrowser.Controller/Sync/IServerSyncProvider.cs +++ b/MediaBrowser.Controller/Sync/IServerSyncProvider.cs @@ -18,7 +18,7 @@ namespace MediaBrowser.Controller.Sync /// The progress. /// The cancellation token. /// Task. - Task SendFile(Stream stream, string remotePath, SyncTarget target, IProgress progress, CancellationToken cancellationToken); + Task SendFile(Stream stream, string remotePath, SyncTarget target, IProgress progress, CancellationToken cancellationToken); /// /// Deletes the file. diff --git a/MediaBrowser.Controller/Sync/SendFileResult.cs b/MediaBrowser.Controller/Sync/SyncedFileInfo.cs similarity index 50% rename from MediaBrowser.Controller/Sync/SendFileResult.cs rename to MediaBrowser.Controller/Sync/SyncedFileInfo.cs index 62753444a..550af2d55 100644 --- a/MediaBrowser.Controller/Sync/SendFileResult.cs +++ b/MediaBrowser.Controller/Sync/SyncedFileInfo.cs @@ -1,8 +1,9 @@ using MediaBrowser.Model.MediaInfo; +using System.Collections.Generic; namespace MediaBrowser.Controller.Sync { - public class SendFileResult + public class SyncedFileInfo { /// /// Gets or sets the path. @@ -14,5 +15,15 @@ namespace MediaBrowser.Controller.Sync /// /// The protocol. public MediaProtocol Protocol { get; set; } + /// + /// Gets or sets the required HTTP headers. + /// + /// The required HTTP headers. + public Dictionary RequiredHttpHeaders { get; set; } + + public SyncedFileInfo() + { + RequiredHttpHeaders = new Dictionary(); + } } } diff --git a/MediaBrowser.Server.Implementations/Sync/MediaSync.cs b/MediaBrowser.Server.Implementations/Sync/MediaSync.cs index befddabd8..03a7e92a4 100644 --- a/MediaBrowser.Server.Implementations/Sync/MediaSync.cs +++ b/MediaBrowser.Server.Implementations/Sync/MediaSync.cs @@ -301,7 +301,7 @@ namespace MediaBrowser.Server.Implementations.Sync } } - private async Task SendFile(IServerSyncProvider provider, string inputPath, string remotePath, SyncTarget target, IProgress progress, CancellationToken cancellationToken) + private async Task SendFile(IServerSyncProvider provider, string inputPath, string remotePath, SyncTarget target, IProgress progress, CancellationToken cancellationToken) { _logger.Debug("Sending {0} to {1}. Remote path: {2}", inputPath, provider.Name, remotePath); using (var stream = _fileSystem.GetFileStream(inputPath, FileMode.Open, FileAccess.Read, FileShare.Read, true)) diff --git a/MediaBrowser.Server.Implementations/Sync/SyncedMediaSourceProvider.cs b/MediaBrowser.Server.Implementations/Sync/SyncedMediaSourceProvider.cs index e7e1d1c63..4172cfc2d 100644 --- a/MediaBrowser.Server.Implementations/Sync/SyncedMediaSourceProvider.cs +++ b/MediaBrowser.Server.Implementations/Sync/SyncedMediaSourceProvider.cs @@ -78,7 +78,7 @@ namespace MediaBrowser.Server.Implementations.Sync SyncTarget target, CancellationToken cancellationToken) { - var requiresDynamicAccess = provider as IRequiresDynamicAccess; + var requiresDynamicAccess = provider as IHasDynamicAccess; if (requiresDynamicAccess == null) { @@ -88,11 +88,11 @@ namespace MediaBrowser.Server.Implementations.Sync try { - var dynamicInfo = await requiresDynamicAccess.GetFileInfo(item.LocalPath, target, cancellationToken).ConfigureAwait(false); + var dynamicInfo = await requiresDynamicAccess.GetSyncedFileInfo(item.LocalPath, target, cancellationToken).ConfigureAwait(false); foreach (var stream in mediaSource.MediaStreams) { - var dynamicStreamInfo = await requiresDynamicAccess.GetFileInfo(stream.ExternalId, target, cancellationToken).ConfigureAwait(false); + var dynamicStreamInfo = await requiresDynamicAccess.GetSyncedFileInfo(stream.ExternalId, target, cancellationToken).ConfigureAwait(false); stream.Path = dynamicStreamInfo.Path; } diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 84187e72b..31441ff79 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.602 + 3.0.603 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ 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 59ec2aa65..568a47dfe 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.602 + 3.0.603 MediaBrowser.Common Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Model.Signed.nuspec b/Nuget/MediaBrowser.Model.Signed.nuspec index 6f4b6a7e3..fb00fd840 100644 --- a/Nuget/MediaBrowser.Model.Signed.nuspec +++ b/Nuget/MediaBrowser.Model.Signed.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Model.Signed - 3.0.602 + 3.0.603 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 4d919a965..c36fb6d6c 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.602 + 3.0.603 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 - +