Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change wording from "crop" to "trim" #1027

Merged
merged 6 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ internal sealed class ChatDownloadArgs : TwitchDownloaderArgs
[Option("compression", Default = ChatCompression.None, HelpText = "Compresses an output json chat file using a specified compression, usually resulting in 40-90% size reductions. Valid values are: None, Gzip.")]
public ChatCompression Compression { get; set; }

[Option('b', "beginning", HelpText = "Time to crop beginning. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration CropBeginningTime { get; set; }
[Option('b', "beginning", HelpText = "Time to trim beginning. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration TrimBeginningTime { get; set; }

[Option('e', "ending", HelpText = "Time to crop ending. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration CropEndingTime { get; set; }
[Option('e', "ending", HelpText = "Time to trim ending. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration TrimEndingTime { get; set; }

[Option('E', "embed-images", Default = false, HelpText = "Embed first party emotes, badges, and cheermotes into the chat download for offline rendering.")]
public bool EmbedData { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions TwitchDownloaderCLI/Modes/Arguments/ChatRenderArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ internal sealed class ChatRenderArgs : TwitchDownloaderArgs
[Option('h', "chat-height", Default = 600, HelpText = "Height of chat render.")]
public int ChatHeight { get; set; }

[Option('b', "beginning", HelpText = "Time to crop beginning of the render. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration CropBeginningTime { get; set; } = new(-1);
[Option('b', "beginning", HelpText = "Time to trim the beginning of the render. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration TrimBeginningTime { get; set; } = new(-1);

[Option('e', "ending", HelpText = "Time to crop ending of the render. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration CropEndingTime { get; set; } = new(-1);
[Option('e', "ending", HelpText = "Time to trim the ending of the render. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration TrimEndingTime { get; set; } = new(-1);

[Option("bttv", Default = true, HelpText = "Enable BTTV emotes.")]
public bool? BttvEmotes { get; set; }
Expand Down
10 changes: 5 additions & 5 deletions TwitchDownloaderCLI/Modes/Arguments/ChatUpdateArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace TwitchDownloaderCLI.Modes.Arguments
{
[Verb("chatupdate", HelpText = "Updates the embedded emotes, badges, bits, and crops of a chat download and/or converts a JSON chat to another format.")]
[Verb("chatupdate", HelpText = "Updates the embedded emotes, badges, bits, and trims a chat JSON and/or converts a JSON chat to another format.")]
internal sealed class ChatUpdateArgs : TwitchDownloaderArgs
{
[Option('i', "input", Required = true, HelpText = "Path to input file. Valid extensions are: .json, .json.gz.")]
Expand All @@ -22,11 +22,11 @@ internal sealed class ChatUpdateArgs : TwitchDownloaderArgs
[Option('R', "replace-embeds", Default = false, HelpText = "Replace all embedded emotes, badges, and cheermotes in the file. All embedded images will be overwritten!")]
public bool ReplaceEmbeds { get; set; }

[Option('b', "beginning", HelpText = "New time for chat beginning. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##). Comments may be added but not removed. -1 = No crop.")]
public TimeDuration CropBeginningTime { get; set; } = new(-1);
[Option('b', "beginning", HelpText = "New time for chat beginning. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##). Comments may be added but not removed. -1 = Keep current trim.")]
public TimeDuration TrimBeginningTime { get; set; } = new(-1);

[Option('e', "ending", HelpText = "New time for chat ending. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##). Comments may be added but not removed. -1 = No crop.")]
public TimeDuration CropEndingTime { get; set; } = new(-1);
[Option('e', "ending", HelpText = "New time for chat ending. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##). Comments may be added but not removed. -1 = Keep current trim.")]
public TimeDuration TrimEndingTime { get; set; } = new(-1);

[Option("bttv", Default = true, HelpText = "Enable BTTV embedding in chat download.")]
public bool? BttvEmotes { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions TwitchDownloaderCLI/Modes/Arguments/VideoDownloadArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ internal sealed class VideoDownloadArgs : TwitchDownloaderArgs
[Option('q', "quality", HelpText = "The quality the program will attempt to download.")]
public string Quality { get; set; }

[Option('b', "beginning", HelpText = "Time to crop beginning. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration CropBeginningTime { get; set; }
[Option('b', "beginning", HelpText = "Time to trim beginning. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration TrimBeginningTime { get; set; }

[Option('e', "ending", HelpText = "Time to crop ending. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration CropEndingTime { get; set; }
[Option('e', "ending", HelpText = "Time to trim ending. Can be milliseconds (#ms), seconds (#s), minutes (#m), hours (#h), or time (##:##:##).")]
public TimeDuration TrimEndingTime { get; set; }

[Option('t', "threads", Default = 4, HelpText = "Number of download threads.")]
public int DownloadThreads { get; set; }
Expand Down
8 changes: 4 additions & 4 deletions TwitchDownloaderCLI/Modes/DownloadChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ private static ChatDownloadOptions GetDownloadOptions(ChatDownloadArgs inputOpti
_ => throw new NotSupportedException($"{fileExtension} is not a valid chat file extension.")
},
Id = vodClipIdMatch.Value,
CropBeginning = inputOptions.CropBeginningTime > TimeSpan.Zero,
CropBeginningTime = ((TimeSpan)inputOptions.CropBeginningTime).TotalSeconds,
CropEnding = inputOptions.CropEndingTime > TimeSpan.Zero,
CropEndingTime = ((TimeSpan)inputOptions.CropEndingTime).TotalSeconds,
TrimBeginning = inputOptions.TrimBeginningTime > TimeSpan.Zero,
TrimBeginningTime = ((TimeSpan)inputOptions.TrimBeginningTime).TotalSeconds,
TrimEnding = inputOptions.TrimEndingTime > TimeSpan.Zero,
TrimEndingTime = ((TimeSpan)inputOptions.TrimEndingTime).TotalSeconds,
EmbedData = inputOptions.EmbedData,
Filename = inputOptions.Compression is ChatCompression.Gzip
? inputOptions.OutputFile + ".gz"
Expand Down
8 changes: 4 additions & 4 deletions TwitchDownloaderCLI/Modes/DownloadVideo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ private static VideoDownloadOptions GetDownloadOptions(VideoDownloadArgs inputOp
".m4a" => "Audio",
_ => throw new ArgumentException("Only MP4 and M4A audio files are supported.")
},
CropBeginning = inputOptions.CropBeginningTime > TimeSpan.Zero,
CropBeginningTime = inputOptions.CropBeginningTime,
CropEnding = inputOptions.CropEndingTime > TimeSpan.Zero,
CropEndingTime = inputOptions.CropEndingTime,
TrimBeginning = inputOptions.TrimBeginningTime > TimeSpan.Zero,
TrimBeginningTime = inputOptions.TrimBeginningTime,
TrimEnding = inputOptions.TrimEndingTime > TimeSpan.Zero,
TrimEndingTime = inputOptions.TrimEndingTime,
FfmpegPath = string.IsNullOrWhiteSpace(inputOptions.FfmpegPath) ? FfmpegHandler.FfmpegExecutableName : Path.GetFullPath(inputOptions.FfmpegPath),
TempFolder = inputOptions.TempFolder,
CacheCleanerCallback = directoryInfos =>
Expand Down
4 changes: 2 additions & 2 deletions TwitchDownloaderCLI/Modes/RenderChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ private static ChatRenderOptions GetRenderOptions(ChatRenderArgs inputOptions, I
MessageColor = SKColor.Parse(inputOptions.MessageColor),
ChatHeight = inputOptions.ChatHeight,
ChatWidth = inputOptions.ChatWidth,
StartOverride = (int)((TimeSpan)inputOptions.CropBeginningTime).TotalSeconds,
EndOverride = (int)((TimeSpan)inputOptions.CropEndingTime).TotalSeconds,
StartOverride = (int)((TimeSpan)inputOptions.TrimBeginningTime).TotalSeconds,
EndOverride = (int)((TimeSpan)inputOptions.TrimEndingTime).TotalSeconds,
BttvEmotes = (bool)inputOptions.BttvEmotes!,
FfzEmotes = (bool)inputOptions.FfzEmotes!,
StvEmotes = (bool)inputOptions.StvEmotes!,
Expand Down
8 changes: 4 additions & 4 deletions TwitchDownloaderCLI/Modes/UpdateChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ private static ChatUpdateOptions GetUpdateOptions(ChatUpdateArgs inputOptions, I
OutputFormat = outFormat,
EmbedMissing = inputOptions.EmbedMissing,
ReplaceEmbeds = inputOptions.ReplaceEmbeds,
CropBeginning = inputOptions.CropBeginningTime >= TimeSpan.Zero,
CropBeginningTime = ((TimeSpan)inputOptions.CropBeginningTime).TotalSeconds,
CropEnding = inputOptions.CropEndingTime >= TimeSpan.Zero,
CropEndingTime = ((TimeSpan)inputOptions.CropEndingTime).TotalSeconds,
TrimBeginning = inputOptions.TrimBeginningTime >= TimeSpan.Zero,
TrimBeginningTime = ((TimeSpan)inputOptions.TrimBeginningTime).TotalSeconds,
TrimEnding = inputOptions.TrimEndingTime >= TimeSpan.Zero,
TrimEndingTime = ((TimeSpan)inputOptions.TrimEndingTime).TotalSeconds,
BttvEmotes = (bool)inputOptions.BttvEmotes!,
FfzEmotes = (bool)inputOptions.FfzEmotes!,
StvEmotes = (bool)inputOptions.StvEmotes!,
Expand Down
10 changes: 5 additions & 5 deletions TwitchDownloaderCLI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Time to trim ending. See [Time durations](#time-durations) for a more detailed e
Path to temporary folder for cache.

## Arguments for mode chatupdate
#### Updates the embedded emotes, badges, bits, and crops of a chat download and/or converts a JSON chat to another format
#### Updates the embedded emotes, badges, bits, and trims a chat JSON and/or converts a JSON chat to another format

**-i / --input (REQUIRED)**
Path to input file. Valid extensions are: `.json`, `.json.gz`.
Expand All @@ -148,10 +148,10 @@ Path to output file. File extension will be used to determine new chat type. Val
(Default: `false`) Replace all embedded emotes, badges, and cheermotes in the file. All embedded data will be overwritten!

**b / --beginning**
(Default: `-1`) New time for chat beginning (`-1` = keep current crop). See [Time durations](#time-durations) for a more detailed explanation. Comments may be added but not removed.
(Default: `-1`) New time for chat beginning (`-1` = keep current trim). See [Time durations](#time-durations) for a more detailed explanation. Comments may be added but not removed.

**-e / --ending**
(Default: `-1`) New time for chat ending (`-1` = keep current crop). See [Time durations](#time-durations) for a more detailed explanation. Comments may be added but not removed.
(Default: `-1`) New time for chat ending (`-1` = keep current trim). See [Time durations](#time-durations) for a more detailed explanation. Comments may be added but not removed.

**--bttv**
(Default: `true`) Enable embedding BTTV emotes.
Expand Down Expand Up @@ -193,10 +193,10 @@ File the program will output to.
(Default: `600`) Height of chat render.

**-b / --beginning**
(Default: `-1`) Time to crop the beginning of the render (`-1` = keep current crop). See [Time durations](#time-durations) for a more detailed explanation.
(Default: `-1`) Time to trim the beginning of the render (`-1` = keep current trim). See [Time durations](#time-durations) for a more detailed explanation.

**-e / --ending**
(Default: `-1`) Time to crop the ending of the render (`-1` = keep current crop). See [Time durations](#time-durations) for a more detailed explanation.
(Default: `-1`) Time to trim the ending of the render (`-1` = keep current trim). See [Time durations](#time-durations) for a more detailed explanation.

**--bttv**
(Default: `true`) Enable BTTV emotes.
Expand Down
Loading