Serve original image file when possible

This commit is contained in:
Luke Pulverenti
2013-11-06 16:32:26 -05:00
parent 221b60b662
commit a2cd03610f
3 changed files with 58 additions and 1 deletions

View File

@@ -40,5 +40,37 @@ namespace MediaBrowser.Controller.Drawing
public int? PercentPlayed { get; set; }
public string BackgroundColor { get; set; }
public bool HasDefaultOptions()
{
return HasDefaultOptionsWithoutSize() &&
!Width.HasValue &&
!Height.HasValue &&
!MaxWidth.HasValue &&
!MaxHeight.HasValue;
}
public bool HasDefaultOptionsWithoutSize()
{
return !CropWhiteSpace &&
(!Quality.HasValue || Quality.Value == 100) &&
IsOutputFormatDefault &&
!AddPlayedIndicator &&
!PercentPlayed.HasValue &&
string.IsNullOrEmpty(BackgroundColor);
}
private bool IsOutputFormatDefault
{
get
{
if (OutputFormat == ImageOutputFormat.Original)
{
return true;
}
return false;
}
}
}
}