Skip to content

Commit

Permalink
Rename TimeSpanExtensions to UrlTimeCode
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Nov 12, 2023
1 parent da76fcc commit 0a85a61
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion TwitchDownloaderCore/Chat/ChatJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private static async Task UpgradeChatJson(ChatRoot chatRoot)

if (chatRoot.video.duration is not null)
{
chatRoot.video.length = TimeSpanExtensions.ParseTimeCode(chatRoot.video.duration).TotalSeconds;
chatRoot.video.length = UrlTimeCode.Parse(chatRoot.video.duration).TotalSeconds;
chatRoot.video.end = chatRoot.video.length;
chatRoot.video.duration = null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using System;

namespace TwitchDownloaderCore.Extensions
namespace TwitchDownloaderCore.Tools
{
public static class TimeSpanExtensions
public static class UrlTimeCode
{
/// <summary>
/// Converts the span representation of a time interval in the format of '2d21h11m9s' to its <see cref="TimeSpan"/> equivalent.
/// </summary>
/// <param name="input">A span containing the characters that represent the time interval to convert.</param>
/// <returns>The <see cref="TimeSpan"/> equivalent to the time interval contained in the <paramref name="input"/> span.</returns>
public static TimeSpan ParseTimeCode(ReadOnlySpan<char> input)
public static TimeSpan Parse(ReadOnlySpan<char> input)
{
var dayIndex = input.IndexOf('d');
var hourIndex = input.IndexOf('h');
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/PageChatDownload.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private async Task GetVideoInfo()
var urlTimeCodeMatch = TwitchRegex.UrlTimeCode.Match(textUrl.Text);
if (urlTimeCodeMatch.Success)
{
var time = TimeSpanExtensions.ParseTimeCode(urlTimeCodeMatch.ValueSpan);
var time = UrlTimeCode.Parse(urlTimeCodeMatch.ValueSpan);
checkCropStart.IsChecked = true;
numStartHour.Value = time.Hours;
numStartMinute.Value = time.Minutes;
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/PageVodDownload.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private async Task GetVideoInfo()
var urlTimeCodeMatch = TwitchRegex.UrlTimeCode.Match(textUrl.Text);
if (urlTimeCodeMatch.Success)
{
var time = TimeSpanExtensions.ParseTimeCode(urlTimeCodeMatch.ValueSpan);
var time = UrlTimeCode.Parse(urlTimeCodeMatch.ValueSpan);
checkStart.IsChecked = true;
numStartHour.Value = time.Hours;
numStartMinute.Value = time.Minutes;
Expand Down

0 comments on commit 0a85a61

Please sign in to comment.