Skip to content

Commit

Permalink
Fix oversight
Browse files Browse the repository at this point in the history
I need to enable nullable ref types :/
  • Loading branch information
ScrubN committed Oct 6, 2023
1 parent 6bbc926 commit 65344c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion TwitchDownloaderCore/ChatDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public async Task DownloadAsync(IProgress<ProgressReport> progress, Cancellation

chatRoot.streamer.name = videoInfoResponse.data.video.owner.displayName;
chatRoot.streamer.id = int.Parse(videoInfoResponse.data.video.owner.id);
chatRoot.video.description = videoInfoResponse.data.video.description.Replace(" \n", "\n").Replace("\n\n", "\n").TrimEnd();
chatRoot.video.description = videoInfoResponse.data.video.description?.Replace(" \n", "\n").Replace("\n\n", "\n").TrimEnd();
videoTitle = videoInfoResponse.data.video.title;
videoCreatedAt = videoInfoResponse.data.video.createdAt;
videoStart = downloadOptions.CropBeginning ? downloadOptions.CropBeginningTime : 0.0;
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderCore/TwitchObjects/Gql/GqlVideoResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class VideoInfo
public VideoGame game { get; set; }
/// <remarks>
/// Some values, such as newlines, are repeated twice for some reason.
/// This can be filtered out with: <code>.Replace(" \n", "\n").Replace("\n\n", "\n").TrimEnd()</code>
/// This can be filtered out with: <code>description?.Replace(" \n", "\n").Replace("\n\n", "\n").TrimEnd()</code>
/// </remarks>
public string description { get; set; }
}
Expand Down
6 changes: 3 additions & 3 deletions TwitchDownloaderCore/VideoDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public async Task DownloadAsync(CancellationToken cancellationToken)
string metadataPath = Path.Combine(downloadFolder, "metadata.txt");
VideoInfo videoInfo = videoInfoResponse.data.video;
await FfmpegMetadata.SerializeAsync(metadataPath, videoInfo.owner.displayName, downloadOptions.Id.ToString(), videoInfo.title, videoInfo.createdAt, videoInfo.viewCount,
videoInfo.description.Replace(" \n", "\n").Replace("\n\n", "\n").TrimEnd(), startOffset, videoChapterResponse.data.video.moments.edges, cancellationToken);
videoInfo.description?.Replace(" \n", "\n").Replace("\n\n", "\n").TrimEnd(), startOffset, videoChapterResponse.data.video.moments.edges, cancellationToken);

var finalizedFileDirectory = Directory.GetParent(Path.GetFullPath(downloadOptions.Filename))!;
if (!finalizedFileDirectory.Exists)
Expand Down Expand Up @@ -223,8 +223,8 @@ static void ExecuteDownloadThread(object state)
throw;
}

const int aPrimeNumber = 71;
Thread.Sleep(aPrimeNumber);
const int A_PRIME_NUMBER = 71;
Thread.Sleep(A_PRIME_NUMBER);
}
}

Expand Down

0 comments on commit 65344c6

Please sign in to comment.