mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 02:18:54 -07:00
adjust profile quality
This commit is contained in:
parent
1a81da5a8f
commit
7ad5a51828
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user