SubtitleEdit/libse/NetflixQualityCheck/NetflixCheckMaxDuration.cs
Nikolaj Olsson f411ce99e1 Added more Netflix checks
TODO: Localication + "Netflix fix errors"
2017-03-24 21:47:13 +01:00

25 lines
818 B
C#

namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
{
public class NetflixCheckMaxDuration : INetflixQualityChecker
{
/// <summary>
/// Maximum duration: 7 seconds per subtitle event
/// </summary>
public void Check(Subtitle subtitle, NetflixQualityController controller)
{
foreach (Paragraph p in subtitle.Paragraphs)
{
if (p.Duration.TotalMilliseconds > 7000)
{
var fixedParagraph = new Paragraph(p, false);
fixedParagraph.Duration.TotalMilliseconds = 7000;
string comment = "Maximum duration: 7 seconds per subtitle event";
controller.AddRecord(p, fixedParagraph, comment);
}
}
}
}
}