chore: apply changes to format end seek

This commit is contained in:
Kevin Heritage 2023-02-17 19:27:30 +01:00
parent 98fdaf424b
commit 59d43bb1c3

View file

@ -1,6 +1,4 @@
using System; namespace FFMpegCore.Arguments
namespace FFMpegCore.Arguments
{ {
/// <summary> /// <summary>
/// Represents seek parameter /// Represents seek parameter
@ -14,15 +12,18 @@ public EndSeekArgument(TimeSpan? seekTo)
SeekTo = seekTo; SeekTo = seekTo;
} }
public string Text { public string Text
get {
if(SeekTo.HasValue)
{ {
int hours = SeekTo.Value.Hours; get
if(SeekTo.Value.Days > 0) {
if (SeekTo.HasValue)
{
var hours = SeekTo.Value.Hours;
if (SeekTo.Value.Days > 0)
{ {
hours += SeekTo.Value.Days * 24; hours += SeekTo.Value.Days * 24;
} }
return $"-to {hours.ToString("00")}:{SeekTo.Value.Minutes.ToString("00")}:{SeekTo.Value.Seconds.ToString("00")}.{SeekTo.Value.Milliseconds.ToString("000")}"; return $"-to {hours.ToString("00")}:{SeekTo.Value.Minutes.ToString("00")}:{SeekTo.Value.Seconds.ToString("00")}.{SeekTo.Value.Milliseconds.ToString("000")}";
} }
else else