|
|
@ -150,14 +150,10 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|
|
|
SyncNewContent = request.SyncNewContent,
|
|
|
|
SyncNewContent = request.SyncNewContent,
|
|
|
|
ItemCount = items.Count,
|
|
|
|
ItemCount = items.Count,
|
|
|
|
Category = request.Category,
|
|
|
|
Category = request.Category,
|
|
|
|
ParentId = request.ParentId
|
|
|
|
ParentId = request.ParentId,
|
|
|
|
|
|
|
|
Quality = request.Quality
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(request.Quality))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
job.Quality = (SyncQuality)Enum.Parse(typeof(SyncQuality), request.Quality, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!request.Category.HasValue && request.ItemIds != null)
|
|
|
|
if (!request.Category.HasValue && request.ItemIds != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var requestedItems = request.ItemIds
|
|
|
|
var requestedItems = request.ItemIds
|
|
|
@ -565,34 +561,6 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|
|
|
return item.Name;
|
|
|
|
return item.Name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public DeviceProfile GetDeviceProfile(string targetId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var provider in _providers)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var target in GetSyncTargets(provider))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (string.Equals(target.Id, targetId, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return GetDeviceProfile(provider, target);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DeviceProfile GetDeviceProfile(ISyncProvider provider, SyncTarget target)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var hasProfile = provider as IHasSyncProfile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasProfile != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return hasProfile.GetDeviceProfile(target);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new CloudSyncProfile(true, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async Task ReportSyncJobItemTransferred(string id)
|
|
|
|
public async Task ReportSyncJobItemTransferred(string id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var jobItem = _repo.GetJobItem(id);
|
|
|
|
var jobItem = _repo.GetJobItem(id);
|
|
|
@ -1021,11 +989,11 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|
|
|
|
|
|
|
|
|
|
|
if (maxBitrate.HasValue)
|
|
|
|
if (maxBitrate.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (job.Quality == SyncQuality.Medium)
|
|
|
|
if (string.Equals(job.Quality, "high", StringComparison.OrdinalIgnoreCase))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
maxBitrate = Convert.ToInt32(maxBitrate.Value * .75);
|
|
|
|
maxBitrate = Convert.ToInt32(maxBitrate.Value * .75);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (job.Quality == SyncQuality.Low)
|
|
|
|
else if (string.Equals(job.Quality, "medium", StringComparison.OrdinalIgnoreCase))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
maxBitrate = Convert.ToInt32(maxBitrate.Value * .5);
|
|
|
|
maxBitrate = Convert.ToInt32(maxBitrate.Value * .5);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1037,5 +1005,33 @@ namespace MediaBrowser.Server.Implementations.Sync
|
|
|
|
MaxBitrate = maxBitrate
|
|
|
|
MaxBitrate = maxBitrate
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DeviceProfile GetDeviceProfile(string targetId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var provider in _providers)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
foreach (var target in GetSyncTargets(provider))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (string.Equals(target.Id, targetId, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return GetDeviceProfile(provider, target);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DeviceProfile GetDeviceProfile(ISyncProvider provider, SyncTarget target)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var hasProfile = provider as IHasSyncProfile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasProfile != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return hasProfile.GetDeviceProfile(target);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new CloudSyncProfile(true, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|