Skip to content

Commit

Permalink
Make ITwitchTask.DependantTask init
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Aug 27, 2024
1 parent 9e09dea commit f7ba474
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public string StatusImage

public ChatDownloadOptions DownloadOptions { get; init; }
public CancellationTokenSource TokenSource { get; private set; } = new();
public ITwitchTask DependantTask { get; set; }
public ITwitchTask DependantTask { get; init; }
public string TaskType { get; } = Translations.Strings.ChatDownload;

private Exception _exception;
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public string StatusImage

public ChatRenderOptions DownloadOptions { get; init; }
public CancellationTokenSource TokenSource { get; private set; } = new();
public ITwitchTask DependantTask { get; set; }
public ITwitchTask DependantTask { get; init; }
public string TaskType { get; } = Translations.Strings.ChatRender;

private Exception _exception;
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public string StatusImage

public ChatUpdateOptions UpdateOptions { get; init; }
public CancellationTokenSource TokenSource { get; private set; } = new();
public ITwitchTask DependantTask { get; set; }
public ITwitchTask DependantTask { get; init; }
public string TaskType { get; } = Translations.Strings.ChatUpdate;

private Exception _exception;
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public string StatusImage

public ClipDownloadOptions DownloadOptions { get; init; }
public CancellationTokenSource TokenSource { get; private set; } = new();
public ITwitchTask DependantTask { get; set; }
public ITwitchTask DependantTask { get; init; }
public string TaskType { get; } = Translations.Strings.ClipDownload;

private Exception _exception;
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/TwitchTasks/ITwitchTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface ITwitchTask : INotifyPropertyChanged
string DisplayStatus { get; }
string StatusImage { get; }
CancellationTokenSource TokenSource { get; }
ITwitchTask DependantTask { get; set; }
ITwitchTask DependantTask { get; init; }
string TaskType { get; }
Exception Exception { get; }
string OutputFile { get; }
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public string StatusImage

public VideoDownloadOptions DownloadOptions { get; init; }
public CancellationTokenSource TokenSource { get; private set; } = new();
public ITwitchTask DependantTask { get; set; }
public ITwitchTask DependantTask { get; init; }
public string TaskType { get; } = Translations.Strings.VodDownload;

private Exception _exception;
Expand Down
4 changes: 2 additions & 2 deletions TwitchDownloaderWPF/WindowQueueOptions.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
{
Title = vodDownloadPage.textTitle.Text,
Thumbnail = vodDownloadPage.imgThumbnail.Source
}
},
DependantTask = chatTask,
};
renderTask.ChangeStatus(TwitchTaskStatus.Waiting);
renderTask.DependantTask = chatTask;

lock (PageQueue.taskLock)
{
Expand Down

0 comments on commit f7ba474

Please sign in to comment.