fix(images): narrow cache path test seam
This commit is contained in:
@@ -252,22 +252,33 @@ public sealed class ImageProcessor : IImageProcessor, IDisposable
|
||||
/// Gets the cache file path based on a set of parameters.
|
||||
/// </summary>
|
||||
/// <param name="originalPath">The original image path.</param>
|
||||
/// <param name="width">The requested width.</param>
|
||||
/// <param name="height">The requested height.</param>
|
||||
/// <param name="maxWidth">The maximum width.</param>
|
||||
/// <param name="maxHeight">The maximum height.</param>
|
||||
/// <param name="fillWidth">The fill width.</param>
|
||||
/// <param name="fillHeight">The fill height.</param>
|
||||
/// <param name="quality">The image quality.</param>
|
||||
/// <param name="dateModified">The source image modification date.</param>
|
||||
/// <param name="format">The output format.</param>
|
||||
/// <param name="percentPlayed">The played percentage overlay value.</param>
|
||||
/// <param name="unwatchedCount">The unwatched count overlay value.</param>
|
||||
/// <param name="blur">The blur amount.</param>
|
||||
/// <param name="backgroundColor">The background color.</param>
|
||||
/// <param name="foregroundLayer">The foreground layer.</param>
|
||||
/// <param name="options">The image processing options.</param>
|
||||
/// <returns>The transformed image cache path.</returns>
|
||||
internal string GetCacheFilePath(
|
||||
string originalPath,
|
||||
DateTime dateModified,
|
||||
ImageFormat format,
|
||||
ImageProcessingOptions options)
|
||||
=> GetCacheFilePath(
|
||||
originalPath,
|
||||
options.Width,
|
||||
options.Height,
|
||||
options.MaxWidth,
|
||||
options.MaxHeight,
|
||||
options.FillWidth,
|
||||
options.FillHeight,
|
||||
options.Quality,
|
||||
dateModified,
|
||||
format,
|
||||
options.PercentPlayed,
|
||||
options.UnplayedCount,
|
||||
options.Blur,
|
||||
options.BackgroundColor,
|
||||
options.ForegroundLayer);
|
||||
|
||||
private string GetCacheFilePath(
|
||||
string originalPath,
|
||||
int? width,
|
||||
int? height,
|
||||
|
||||
@@ -105,20 +105,27 @@ public sealed class ImageProcessorTests : IDisposable
|
||||
}
|
||||
|
||||
private string GetCacheFilePath(double percentPlayed = 0, int? unwatchedCount = null)
|
||||
=> _imageProcessor.GetCacheFilePath(
|
||||
{
|
||||
var options = new ImageProcessingOptions
|
||||
{
|
||||
Width = 200,
|
||||
Height = 300,
|
||||
MaxWidth = 400,
|
||||
MaxHeight = 500,
|
||||
FillWidth = 600,
|
||||
FillHeight = 700,
|
||||
Quality = 90,
|
||||
PercentPlayed = percentPlayed,
|
||||
UnplayedCount = unwatchedCount,
|
||||
Blur = 2,
|
||||
BackgroundColor = "000000",
|
||||
ForegroundLayer = "layer"
|
||||
};
|
||||
|
||||
return _imageProcessor.GetCacheFilePath(
|
||||
OriginalPath,
|
||||
width: 200,
|
||||
height: 300,
|
||||
maxWidth: 400,
|
||||
maxHeight: 500,
|
||||
fillWidth: 600,
|
||||
fillHeight: 700,
|
||||
quality: 90,
|
||||
dateModified: _dateModified,
|
||||
format: ImageFormat.Jpg,
|
||||
percentPlayed,
|
||||
unwatchedCount,
|
||||
blur: 2,
|
||||
backgroundColor: "000000",
|
||||
foregroundLayer: "layer");
|
||||
_dateModified,
|
||||
ImageFormat.Jpg,
|
||||
options);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user