Add PowerKit and Gress integrations; replace redundant utilities/extensions#812
Add PowerKit and Gress integrations; replace redundant utilities/extensions#812
Conversation
…alents Agent-Logs-Url: https://github.com/Tyrrrz/YoutubeDownloader/sessions/7c7349ae-ffce-4c33-b3b5-0882c1659352 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
|
I think you might be able to replace DisposableCollector with Disposable.Merge entirely @copilot |
Agent-Logs-Url: https://github.com/Tyrrrz/YoutubeDownloader/sessions/55d71ace-dd10-4d1a-a4f8-3176e56c8edd Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Done in 50547b8. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot rename _eventRoot to _eventSubscription |
Agent-Logs-Url: https://github.com/Tyrrrz/YoutubeDownloader/sessions/91e78ff5-a9a2-4554-be5a-ed8b08165654 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Done in 895dab0 — renamed across all 6 files. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot update PowerKit to the latest pre-release version and check if you can replace more utilities/extensions now. Also check if any of its provided utilities/extensions can be useful to refactor existing code. |
Agent-Logs-Url: https://github.com/Tyrrrz/YoutubeDownloader/sessions/01eca976-d1f2-42f0-863a-12cb1f081be0 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/YoutubeDownloader/sessions/01eca976-d1f2-42f0-863a-12cb1f081be0 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
|
@copilot please fix build errors |
Agent-Logs-Url: https://github.com/Tyrrrz/YoutubeDownloader/sessions/ce2f1fa9-2c5e-41e3-a71f-d7f43273051e Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Fixed in 9a3ab92 — the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot if you update Gress, you should be able to remove a few more extensions I believe. |
Agent-Logs-Url: https://github.com/Tyrrrz/YoutubeDownloader/sessions/75bd08fc-28c1-4014-a433-3e5ebc4bfbc5 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Done in bf454e2. Updated Gress to Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot also please update PowerKit. It comes with |
…GetFileName Agent-Logs-Url: https://github.com/Tyrrrz/YoutubeDownloader/sessions/9db7dc72-fc1d-4374-8aa6-4a4922ef5bf4 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Done in 64bdf99. Updated PowerKit to Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the solution to rely on PowerKit and Gress 2.2.0 for common integrations/utilities, removing several local helper/extension implementations that are now redundant.
Changes:
- Add PowerKit package references (UI + Core) and bump Gress to
2.2.0via central package management. - Replace local utility classes (e.g.,
DisposableCollector,ResizableSemaphore,ThrottleLock, various extensions) with PowerKit/Gress equivalents. - Update call sites/usings accordingly (e.g.,
Directory.CreateForFile,Process.StartShellExecute,HttpClient.DownloadAsync).
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| YoutubeDownloader/YoutubeDownloader.csproj | Adds PowerKit dependency to the UI project. |
| YoutubeDownloader/Views/Components/DashboardView.axaml.cs | Switches ExecuteIfCan extension import to PowerKit. |
| YoutubeDownloader/ViewModels/MainViewModel.cs | Uses PowerKit Process extensions for shell execute. |
| YoutubeDownloader/ViewModels/Dialogs/SettingsViewModel.cs | Replaces DisposableCollector with single IDisposable subscription. |
| YoutubeDownloader/ViewModels/Dialogs/DownloadSingleSetupViewModel.cs | Uses PowerKit Directory.CreateForFile. |
| YoutubeDownloader/ViewModels/Dialogs/DownloadMultipleSetupViewModel.cs | Uses PowerKit Directory.CreateForFile. |
| YoutubeDownloader/ViewModels/Dialogs/AuthSetupViewModel.cs | Replaces DisposableCollector with single IDisposable subscription. |
| YoutubeDownloader/ViewModels/Components/DownloadViewModel.cs | Replaces DisposableCollector with single IDisposable subscription; uses PowerKit Process extensions. |
| YoutubeDownloader/ViewModels/Components/DashboardViewModel.cs | Replaces DisposableCollector with Disposable.Merge; migrates ResizableSemaphore to PowerKit. |
| YoutubeDownloader/Utils/ResizableSemaphore.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader/Utils/Extensions/ProcessExtensions.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader/Utils/Extensions/NotifyPropertyChangedExtensions.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader/Utils/Extensions/DisposableExtensions.cs | Deleted (no longer needed after PowerKit migration). |
| YoutubeDownloader/Utils/Extensions/DirectoryExtensions.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader/Utils/Extensions/CommandExtensions.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader/Utils/DisposableCollector.cs | Deleted (replaced by Disposable.Merge / individual IDisposable fields). |
| YoutubeDownloader/Utils/Disposable.cs | Deleted (replaced by PowerKit Disposable). |
| YoutubeDownloader/Localization/LocalizationManager.cs | Uses Disposable.Merge + PowerKit property-watch extensions. |
| YoutubeDownloader/Framework/ViewModelManager.cs | Uses PowerKit collection extensions (AddRange). |
| YoutubeDownloader/App.axaml.cs | Replaces DisposableCollector with single IDisposable subscription for theme watching. |
| YoutubeDownloader.Core/YoutubeDownloader.Core.csproj | Adds PowerKit dependency to the Core project. |
| YoutubeDownloader.Core/Utils/Url.cs | Deleted (replaced by PowerKit URI helpers). |
| YoutubeDownloader.Core/Utils/ThrottleLock.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader.Core/Utils/Http.cs | Uses PowerKit assembly version helper for User-Agent. |
| YoutubeDownloader.Core/Utils/Extensions/YoutubeExtensions.cs | Deleted (replaced by new thumbnail extension). |
| YoutubeDownloader.Core/Utils/Extensions/ThumbnailExtensions.cs | New: derives thumbnail image format using PowerKit URI helpers. |
| YoutubeDownloader.Core/Utils/Extensions/StringExtensions.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader.Core/Utils/Extensions/StreamExtensions.cs | Deleted (was only used by removed HTTP extension). |
| YoutubeDownloader.Core/Utils/Extensions/PathExtensions.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader.Core/Utils/Extensions/HttpExtensions.cs | Deleted (replaced by Gress HttpClient integration). |
| YoutubeDownloader.Core/Utils/Extensions/GenericExtensions.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader.Core/Utils/Extensions/CollectionExtensions.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader.Core/Utils/Extensions/AsyncCollectionExtensions.cs | Deleted (now provided by PowerKit). |
| YoutubeDownloader.Core/Tagging/MusicBrainzClient.cs | Migrates ThrottleLock usage to PowerKit type. |
| YoutubeDownloader.Core/Tagging/MediaTagInjector.cs | Uses new ThumbnailExtensions.TryGetImageFormat. |
| YoutubeDownloader.Core/Downloading/VideoDownloadOption.cs | Switches to PowerKit extensions for collection helpers. |
| YoutubeDownloader.Core/Downloading/FileNameTemplate.cs | Switches to PowerKit Path.EscapeFileName. |
| YoutubeDownloader.Core/Downloading/FFmpeg.cs | Switches to Gress.Integrations HttpClient download extension. |
| Directory.Packages.props | Adds PowerKit 1.1.1 and bumps Gress to 2.2.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1.1.12.2.0ResizableSemaphore.cs— now in PowerKitThrottleLock.cs— now in PowerKitDirectoryExtensions.cs—Directory.CreateForFilenow in PowerKitCommandExtensions.cs—ExecuteIfCannow in PowerKitNotifyPropertyChangedExtensions.cs— now in PowerKitProcessExtensions.cs—Process.StartShellExecutenow in PowerKitDisposableCollector.cs— replaced byDisposable.Mergefrom PowerKitHttpExtensions.cs—HttpClient.DownloadAsyncnow inGress.Integrations.HttpClientExtensionsStreamExtensions.cs— only used internally by the deletedHttpExtensionsUrl.cs—Url.TryExtractFileNamereplaced byUri.TryGetFileName()from PowerKitCreateDirectoryForFile→CreateForFileat all call sitesDisposableCollectorusage withIDisposable _eventSubscriptionfields; multi-subscription sites useDisposable.Mergeusingdirectives in all affected files (addPowerKit.Extensions/Gress.Integrations, remove staleYoutubeDownloader.Utils.Extensionswhere no longer needed)