private static bool IsStreaming(MediaFile mediaFile)
 {
     return(mediaFile.Delivery == MediaFileDelivery.Streaming);
 }
 private static double CompareSize(MediaFile mediaFile, Size targetSize)
 {
     return(Math.Abs(mediaFile.Height * mediaFile.Width - targetSize.Height * targetSize.Width));
 }
 private static double CompareBitrate(MediaFile mediaFile, double targetBitrateKbps)
 {
     return(Math.Abs(mediaFile.Bitrate.GetValueOrDefault(int.MaxValue) - targetBitrateKbps));
 }
 private static double CompareAspectRatio(MediaFile mediaFile, Size targetSize)
 {
     // round to 1 decimal place in case width/height isn't 100% exactly the same for 2 different media files with nearly identical aspect ratios.
     return(Math.Abs(Math.Round((double)mediaFile.Width / (double)mediaFile.Height, 1) - Math.Round(targetSize.Width / targetSize.Height, 1)));
 }