From f7ba474d77e351e56efcdec039d0be66dd74c18b Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Mon, 26 Aug 2024 23:55:43 -0400 Subject: [PATCH] Make ITwitchTask.DependantTask init --- TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs | 2 +- TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs | 2 +- TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs | 2 +- TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs | 2 +- TwitchDownloaderWPF/TwitchTasks/ITwitchTask.cs | 2 +- TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs | 2 +- TwitchDownloaderWPF/WindowQueueOptions.xaml.cs | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs b/TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs index 715da1e2..ecec89c3 100644 --- a/TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/ChatDownloadTask.cs @@ -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; diff --git a/TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs b/TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs index 62da17cd..13db3a4c 100644 --- a/TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/ChatRenderTask.cs @@ -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; diff --git a/TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs b/TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs index 2dc78a74..d5072417 100644 --- a/TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/ChatUpdateTask.cs @@ -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; diff --git a/TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs b/TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs index d0e6bc8e..c130bbe9 100644 --- a/TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/ClipDownloadTask.cs @@ -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; diff --git a/TwitchDownloaderWPF/TwitchTasks/ITwitchTask.cs b/TwitchDownloaderWPF/TwitchTasks/ITwitchTask.cs index 36f496ae..349e69ff 100644 --- a/TwitchDownloaderWPF/TwitchTasks/ITwitchTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/ITwitchTask.cs @@ -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; } diff --git a/TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs b/TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs index aefbba88..e80bc5a2 100644 --- a/TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs +++ b/TwitchDownloaderWPF/TwitchTasks/VodDownloadTask.cs @@ -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; diff --git a/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs b/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs index cd9c0259..33f3e0c2 100644 --- a/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs +++ b/TwitchDownloaderWPF/WindowQueueOptions.xaml.cs @@ -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) {