Skip to content

Commit

Permalink
Fix downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
lay295 committed Sep 27, 2023
1 parent e45d8af commit 55d5ba6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private async Task<List<Comment>> DownloadSection(int streamerId, DateTime video
comments.EnsureCapacity(Math.Min(0, comments.Capacity + convertedComments.Count));
foreach (var comment in convertedComments)
{
if (latestMessage < videoEnd && comment.content_offset_seconds > videoStart)
if (latestMessage < videoEnd && comment.content_offset_seconds >= videoStart)
comments.Add(comment);

latestMessage = comment.content_offset_seconds;
Expand Down Expand Up @@ -305,7 +305,7 @@ public async Task DownloadAsync(CancellationToken cancellationToken)
chatRoot.video.game = game;
videoDuration = videoEnd - videoStart;

int downloadChunks = Math.Max(1, (int)videoDuration);
int downloadChunks = Math.Max(1, (int)videoDuration / 5);
var tasks = new List<Func<Task<List<Comment>>>>();
var percentages = new int[downloadChunks];

Expand Down
7 changes: 0 additions & 7 deletions TwitchDownloaderWPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ public partial class MainWindow : Window
public static PageChatRender pageChatRender = new PageChatRender();
public static PageQueue pageQueue = new PageQueue();

[DllImport("Kernel32")]
public static extern void AllocConsole();

[DllImport("Kernel32")]
public static extern void FreeConsole();

public MainWindow()
{
InitializeComponent();
Expand Down Expand Up @@ -102,7 +96,6 @@ private async void Window_Loaded(object sender, RoutedEventArgs e)
Version currentVersion = new Version("1.53.2");
Title = $"Twitch Downloader v{currentVersion}";
AutoUpdater.InstalledVersion = currentVersion;
AllocConsole();
#if !DEBUG
if (AppContext.BaseDirectory.StartsWith(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)))
{
Expand Down

0 comments on commit 55d5ba6

Please sign in to comment.