adjust profile quality

This commit is contained in:
Luke Pulverenti 2015-03-12 01:12:02 -04:00
parent 1a81da5a8f
commit 7ad5a51828

View File

@ -1017,7 +1017,29 @@ namespace MediaBrowser.Server.Implementations.Sync
return hasProfile.GetDeviceProfile(target, quality);
}
return new CloudSyncProfile(true, false);
return GetDefaultProfile(quality);
}
private DeviceProfile GetDefaultProfile(string quality)
{
var profile = new CloudSyncProfile(true, false);
var maxBitrate = profile.MaxStaticBitrate;
if (maxBitrate.HasValue)
{
if (string.Equals(quality, "medium", StringComparison.OrdinalIgnoreCase))
{
maxBitrate = Convert.ToInt32(maxBitrate.Value * .75);
}
else if (string.Equals(quality, "low", StringComparison.OrdinalIgnoreCase))
{
maxBitrate = Convert.ToInt32(maxBitrate.Value * .5);
}
profile.MaxStaticBitrate = maxBitrate;
}
return profile;
}
public IEnumerable<SyncQualityOption> GetQualityOptions(string targetId)