mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 03:26:07 +02:00
added cloud sync logging message
This commit is contained in:
parent
febfc0ccfa
commit
5c597be7de
1 changed files with 26 additions and 0 deletions
|
@ -168,6 +168,17 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
// Create db record
|
||||
await dataProvider.AddOrUpdate(target, localItem).ConfigureAwait(false);
|
||||
|
||||
if (localItem.Item.MediaSources != null)
|
||||
{
|
||||
var mediaSource = localItem.Item.MediaSources.FirstOrDefault();
|
||||
if (mediaSource != null)
|
||||
{
|
||||
mediaSource.Path = sendFileResult.Path;
|
||||
mediaSource.Protocol = sendFileResult.Protocol;
|
||||
mediaSource.SupportsTranscoding = false;
|
||||
}
|
||||
}
|
||||
|
||||
progress.Report(92);
|
||||
|
||||
transferSuccess = true;
|
||||
|
@ -192,6 +203,20 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
}
|
||||
}
|
||||
|
||||
private async Task SendSubtitles(LocalItem localItem, MediaSourceInfo mediaSource, IServerSyncProvider provider, ISyncDataProvider dataProvider, SyncTarget target, CancellationToken cancellationToken)
|
||||
{
|
||||
foreach (var mediaStream in mediaSource.MediaStreams
|
||||
.Where(i => i.Type == MediaStreamType.Subtitle && i.IsExternal)
|
||||
.ToList())
|
||||
{
|
||||
var sendFileResult = await SendFile(provider, mediaStream.Path, localItem, target, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
mediaStream.Path = sendFileResult.Path;
|
||||
|
||||
await dataProvider.AddOrUpdate(target, localItem).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task RemoveItem(IServerSyncProvider provider,
|
||||
ISyncDataProvider dataProvider,
|
||||
string serverId,
|
||||
|
@ -216,6 +241,7 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|||
|
||||
private async Task<SendFileResult> SendFile(IServerSyncProvider provider, string inputPath, LocalItem item, SyncTarget target, CancellationToken cancellationToken)
|
||||
{
|
||||
_logger.Debug("Sending {0} to {1}. Remote path: {2}", inputPath, provider.Name, item.LocalPath);
|
||||
using (var stream = _fileSystem.GetFileStream(inputPath, FileMode.Open, FileAccess.Read, FileShare.Read, true))
|
||||
{
|
||||
return await provider.SendFile(stream, item.LocalPath, target, new Progress<double>(), cancellationToken).ConfigureAwait(false);
|
||||
|
|
Loading…
Reference in a new issue