mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 11:42:36 +01:00
Do not create a list for just one item
This commit is contained in:
parent
1b9f243ffa
commit
1c7bc9d28e
@ -37,7 +37,7 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
|
||||
List<double> nextStartSceneChanges = SceneChanges.Where(x => SubtitleFormat.MillisecondsToFrames(x * 1000) > SubtitleFormat.MillisecondsToFrames(p.StartTime.TotalMilliseconds)).ToList();
|
||||
List<double> previousEndSceneChanges = SceneChanges.Where(x => SubtitleFormat.MillisecondsToFrames(x * 1000) < SubtitleFormat.MillisecondsToFrames(p.EndTime.TotalMilliseconds)).ToList();
|
||||
List<double> nextEndSceneChanges = SceneChanges.Where(x => SubtitleFormat.MillisecondsToFrames(x * 1000) > SubtitleFormat.MillisecondsToFrames(p.EndTime.TotalMilliseconds)).ToList();
|
||||
List<double> onSceneChange = SceneChanges.Where(x => SubtitleFormat.MillisecondsToFrames(x * 1000) == SubtitleFormat.MillisecondsToFrames(p.EndTime.TotalMilliseconds)).ToList();
|
||||
var onSceneChange = SceneChanges.Where(x => SubtitleFormat.MillisecondsToFrames(x * 1000) == SubtitleFormat.MillisecondsToFrames(p.EndTime.TotalMilliseconds)).FirstOrDefault();
|
||||
|
||||
if (previousStartSceneChanges.Count > 0)
|
||||
{
|
||||
@ -72,9 +72,9 @@ namespace Nikse.SubtitleEdit.Core.NetflixQualityCheck
|
||||
}
|
||||
}
|
||||
|
||||
if (onSceneChange.Count > 0)
|
||||
if (onSceneChange > 0)
|
||||
{
|
||||
fixedParagraph.EndTime.TotalMilliseconds = onSceneChange[0] * 1000 - twoFramesGap;
|
||||
fixedParagraph.EndTime.TotalMilliseconds = onSceneChange * 1000 - twoFramesGap;
|
||||
comment = "The out-cue is on the Shot Change";
|
||||
controller.AddRecord(p, fixedParagraph, comment);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user