Skip to content

Commit 40e274d

Browse files
committed
9️⃣ Upgrade to .NET 9
1 parent 0f45cd2 commit 40e274d

File tree

10 files changed

+28
-26
lines changed

10 files changed

+28
-26
lines changed

.github/workflows/build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,22 @@ jobs:
4747
uses: actions/upload-artifact@v4
4848
with:
4949
name: youtube-dl-wpf-${{ github.sha }}-windows
50-
path: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/publish/
50+
path: YoutubeDl.Wpf/bin/Release/net9.0-windows10.0.26100.0/publish/
5151

5252
- name: Upload artifacts for Windows ARM64
5353
uses: actions/upload-artifact@v4
5454
with:
5555
name: youtube-dl-wpf-${{ github.sha }}-windows-arm64
56-
path: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/win-arm64/publish/
56+
path: YoutubeDl.Wpf/bin/Release/net9.0-windows10.0.26100.0/win-arm64/publish/
5757

5858
- name: Upload artifacts for Windows x64
5959
uses: actions/upload-artifact@v4
6060
with:
6161
name: youtube-dl-wpf-${{ github.sha }}-windows-x64
62-
path: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/win-x64/publish/
62+
path: YoutubeDl.Wpf/bin/Release/net9.0-windows10.0.26100.0/win-x64/publish/
6363

6464
- name: Upload artifacts for Windows x86
6565
uses: actions/upload-artifact@v4
6666
with:
6767
name: youtube-dl-wpf-${{ github.sha }}-windows-x86
68-
path: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/win-x86/publish/
68+
path: YoutubeDl.Wpf/bin/Release/net9.0-windows10.0.26100.0/win-x86/publish/

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# Package
3333
- name: Package for Windows
3434
run: |
35-
cd YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/publish
35+
cd YoutubeDl.Wpf/bin/Release/net9.0-windows10.0.26100.0/publish
3636
7z a -tzip -mx=9 -mfb=128 ../youtube-dl-wpf-${{ github.ref_name }}-windows.zip .
3737
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on ../youtube-dl-wpf-${{ github.ref_name }}-windows.7z .
3838
cd ../win-arm64/publish
@@ -50,7 +50,7 @@ jobs:
5050
uses: svenstaro/upload-release-action@v2
5151
with:
5252
repo_token: ${{ secrets.GITHUB_TOKEN }}
53-
file: YoutubeDl.Wpf/bin/Release/net8.0-windows10.0.22621.0/youtube-dl-wpf-*
53+
file: YoutubeDl.Wpf/bin/Release/net9.0-windows10.0.26100.0/youtube-dl-wpf-*
5454
tag: ${{ github.ref }}
5555
file_glob: true
5656
prerelease: true

.vscode/launch.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"type": "coreclr",
77
"request": "launch",
88
"preLaunchTask": "Build Solution (Debug)",
9-
"program": "${workspaceFolder}/YoutubeDl.Wpf/bin/Debug/net5.0/youtube-dl-wpf.dll",
9+
"program": "${workspaceFolder}/YoutubeDl.Wpf/bin/Debug/net9.0-windows10.0.26100.0/youtube-dl-wpf.dll",
1010
"args": [],
11-
"cwd": "${workspaceFolder}/YoutubeDl.Wpf/bin/Debug/net5.0",
11+
"cwd": "${workspaceFolder}/YoutubeDl.Wpf/bin/Debug/net9.0-windows10.0.26100.0",
1212
"stopAtEntry": false,
1313
"console": "integratedTerminal"
1414
},

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ WPF GUI for [youtube-dl](https://github.com/ytdl-org/youtube-dl) and [yt-dlp](ht
6262

6363
## Build
6464

65-
Prerequisites: .NET 8 SDK
65+
Prerequisites: .NET 9 SDK
6666

6767
Note for packagers: The application by default uses executable directory as config directory. To use user's config directory, define the constant `PACKAGED` when building.
6868

@@ -99,4 +99,4 @@ dotnet publish YoutubeDl.Wpf -c Release -p:DefineConstants=PACKAGED -r win-x64 -
9999
- [Roboto Mono](https://fonts.google.com/specimen/Roboto+Mono) is licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
100100
- [ReactiveUI](https://github.com/reactiveui/ReactiveUI) and its dependencies are licensed under [MIT](https://github.com/reactiveui/ReactiveUI/blob/main/LICENSE).
101101

102-
© 2024 database64128
102+
© 2025 database64128

YoutubeDl.Wpf.Tests/YoutubeDl.Wpf.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
4+
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77

YoutubeDl.Wpf/Models/ObservableSettings.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ public class ObservableSettings(Settings settings) : ReactiveObject
2929
/// Gets or sets the list of arguments passed
3030
/// to the backend process for all types of operations.
3131
/// </summary>
32-
public ObservableCollection<BackendArgument> BackendGlobalArguments { get; set; } = new(settings.BackendGlobalArguments);
32+
public ObservableCollection<BackendArgument> BackendGlobalArguments { get; set; } = [.. settings.BackendGlobalArguments];
3333

3434
/// <summary>
3535
/// Gets or sets the list of arguments passed
3636
/// to the backend process for download operations.
3737
/// </summary>
38-
public List<BackendArgument> BackendDownloadArguments { get; set; } = new(settings.BackendDownloadArguments);
38+
public List<BackendArgument> BackendDownloadArguments { get; set; } = [.. settings.BackendDownloadArguments];
3939

4040
[Reactive]
4141
public bool BackendAutoUpdate { get; set; } = settings.BackendAutoUpdate;
@@ -63,7 +63,7 @@ public class ObservableSettings(Settings settings) : ReactiveObject
6363
[Reactive]
6464
public string SelectedPresetText { get; set; } = settings.SelectedPreset.DisplayName;
6565

66-
public List<Preset> CustomPresets { get; set; } = new(settings.CustomPresets);
66+
public List<Preset> CustomPresets { get; set; } = [.. settings.CustomPresets];
6767

6868
[Reactive]
6969
public bool AddMetadata { get; set; } = settings.AddMetadata;
@@ -93,7 +93,7 @@ public class ObservableSettings(Settings settings) : ReactiveObject
9393
/// Gets the list of used output templates.
9494
/// New templates are appended to the list.
9595
/// </summary>
96-
public List<string> OutputTemplateHistory { get; } = new(settings.OutputTemplateHistory);
96+
public List<string> OutputTemplateHistory { get; } = [.. settings.OutputTemplateHistory];
9797

9898
[Reactive]
9999
public bool UseCustomPath { get; set; } = settings.UseCustomPath;
@@ -105,7 +105,7 @@ public class ObservableSettings(Settings settings) : ReactiveObject
105105
/// Gets the list of used download paths.
106106
/// New paths are appended to the list.
107107
/// </summary>
108-
public List<string> DownloadPathHistory { get; } = new(settings.DownloadPathHistory);
108+
public List<string> DownloadPathHistory { get; } = [.. settings.DownloadPathHistory];
109109

110110
public void UpdateAppSettings()
111111
{

YoutubeDl.Wpf/Models/QueuedTextBoxSink.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
using System;
66
using System.Collections.Generic;
77
using System.Reactive.Concurrency;
8+
using System.Threading;
89

910
namespace YoutubeDl.Wpf.Models;
1011

1112
public class QueuedTextBoxSink(Settings settings, IFormatProvider? formatProvider = null) : ReactiveObject, ILogEventSink
1213
{
13-
private readonly object _locker = new();
14+
private readonly Lock _lock = new();
1415
private readonly Queue<string> _queuedLogMessages = new(settings.LoggingMaxEntries);
1516
private int _contentLength;
1617

@@ -54,7 +55,7 @@ public void Emit(LogEvent logEvent)
5455
Environment.NewLine.CopyTo(buf[(34 + renderedMessage.Length)..]);
5556
});
5657

57-
lock (_locker)
58+
lock (_lock)
5859
{
5960
while (_queuedLogMessages.Count >= settings.LoggingMaxEntries)
6061
{

YoutubeDl.Wpf/ViewModels/HomeViewModel.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,13 @@ public HomeViewModel(ObservableSettings settings, BackendService backendService,
125125
Presets.AddRange(Preset.PredefinedPresets.Where(x => (x.SupportedBackends & SharedSettings.Backend) == SharedSettings.Backend));
126126
});
127127

128-
OutputTemplateHistory = new(SharedSettings.OutputTemplateHistory.Select(x => new HistoryItemViewModel(x, DeleteOutputTemplateItem)).Reverse());
129-
DownloadPathHistory = new(SharedSettings.DownloadPathHistory.Select(x => new HistoryItemViewModel(x, DeleteDownloadPathItem)).Reverse());
130-
DownloadArguments = new(SharedSettings.BackendDownloadArguments.Select(x => new ArgumentChipViewModel(x, true, DeleteArgumentChip)))
131-
{
128+
OutputTemplateHistory = [.. SharedSettings.OutputTemplateHistory.Select(x => new HistoryItemViewModel(x, DeleteOutputTemplateItem)).Reverse()];
129+
DownloadPathHistory = [.. SharedSettings.DownloadPathHistory.Select(x => new HistoryItemViewModel(x, DeleteDownloadPathItem)).Reverse()];
130+
DownloadArguments =
131+
[
132+
.. SharedSettings.BackendDownloadArguments.Select(x => new ArgumentChipViewModel(x, true, DeleteArgumentChip)),
132133
new AddArgumentViewModel(AddArgument),
133-
};
134+
];
134135

135136
var gdaA = this.WhenAnyValue(
136137
x => x.SharedSettings.Backend,

YoutubeDl.Wpf/ViewModels/PresetDialogViewModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private Preset ToPreset()
144144
FormatArg = string.IsNullOrEmpty(FormatArg) ? null : FormatArg,
145145
ContainerArg = string.IsNullOrEmpty(ContainerArg) ? null : ContainerArg,
146146
SupportedBackends = supportedBackends,
147-
ExtraArgs = _backendArguments.Select(x => x.Argument).ToArray(),
147+
ExtraArgs = [.. _backendArguments.Select(x => x.Argument)],
148148
};
149149
}
150150

YoutubeDl.Wpf/YoutubeDl.Wpf.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
5+
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
66
<UseWPF>true</UseWPF>
77
<ApplicationManifest>app.manifest</ApplicationManifest>
88
<Product>Cube YouTube Downloader</Product>
99
<Authors>database64128</Authors>
1010
<Version>1.13.0</Version>
1111
<ApplicationIcon>CubeYouTubeDownloader.ico</ApplicationIcon>
1212
<Description>WPF GUI for https://github.com/ytdl-org/youtube-dl and https://github.com/yt-dlp/yt-dlp.</Description>
13-
<Copyright2024 database64128</Copyright>
13+
<Copyright2025 database64128</Copyright>
1414
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1515
<PackageProjectUrl>https://github.com/database64128/youtube-dl-wpf</PackageProjectUrl>
1616
<PackageIcon>CubeYouTubeDownloader.png</PackageIcon>

0 commit comments

Comments
 (0)