Skip to content

Commit

Permalink
Estimate video creation date for CRV 1.0.0 chats, update English tran…
Browse files Browse the repository at this point in the history
…slation
  • Loading branch information
ScrubN committed Apr 4, 2023
1 parent c4c4a6f commit 4f72ccf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions TwitchDownloaderWPF/PageChatUpdate.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@ private async void btnBrowse_Click(object sender, RoutedEventArgs e)
ChatJsonInfo = await ChatJson.DeserializeAsync(InputFile, true, false, CancellationToken.None);
ChatJsonInfo.comments.RemoveRange(1, ChatJsonInfo.comments.Count - 2);
GC.Collect();
textStreamer.Text = ChatJsonInfo.streamer.name;
var videoCreatedAt = ChatJsonInfo.video.created_at;

var videoCreatedAt = ChatJsonInfo.video.created_at == DateTime.MinValue
? ChatJsonInfo.comments[0].created_at - TimeSpan.FromSeconds(ChatJsonInfo.comments[0].content_offset_seconds)
: ChatJsonInfo.video.created_at;
textCreatedAt.Text = Settings.Default.UTCVideoTime ? videoCreatedAt.ToString(CultureInfo.CurrentCulture) : videoCreatedAt.ToLocalTime().ToString(CultureInfo.CurrentCulture);
VideoCreatedAt = Settings.Default.UTCVideoTime ? videoCreatedAt : videoCreatedAt.ToLocalTime();

textStreamer.Text = ChatJsonInfo.streamer.name;
textTitle.Text = ChatJsonInfo.video.title ?? Translations.Strings.Unknown;

TimeSpan chatStart = TimeSpan.FromSeconds(ChatJsonInfo.video.start);
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/Translations/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/Translations/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@
<value>Top 24 Hours</value>
</data>
<data name="UnableToFindThumbnail" xml:space="preserve">
<value>Unable To Find Thumbnail</value>
<value>Unable to find thumbnail</value>
</data>
<data name="UnableToGetClipInfo" xml:space="preserve">
<value>Unable to get Clip information. Please double check Clip ID and try again.</value>
Expand Down

0 comments on commit 4f72ccf

Please sign in to comment.