Skip to content

Add PowerKit and JsonExtensions; remove duplicate local utilities/extensions#948

Merged
Tyrrrz merged 13 commits intoprimefrom
copilot/add-powerkit-package
Apr 18, 2026
Merged

Add PowerKit and JsonExtensions; remove duplicate local utilities/extensions#948
Tyrrrz merged 13 commits intoprimefrom
copilot/add-powerkit-package

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

Replaces local utility/extension files across all projects with the PowerKit and JsonExtensions NuGet packages, and updates both packages to their latest pre-release versions. Also applies further cleanups using PowerKit's extension methods.

Changes Made

Main library (YoutubeExplode)

  • Deleted PathExtensions.csPath.SanitizeFileName replaced by Path.EscapeFileName from PowerKit.Extensions
  • Deleted AsyncCollectionExtensions.csOfTypeAsync covered by PowerKit.Extensions.AsyncEnumerableExtensions
  • Deleted HttpExtensions.csClone and HeadAsync covered by PowerKit.Extensions.HttpRequestMessageExtensions / HttpClientExtensions
  • Deleted UriExtensions.csDomain covered by PowerKit.Extensions.UriExtensions
  • Deleted XElementExtensions.csStripNamespaces covered by PowerKit.Extensions.XElementExtensions
  • Deleted Hash.csHash.Compute replaced by HashAlgorithm.ComputeHash static extension from PowerKit.Extensions
  • Deleted ClientDelegatingHandler.cs — replaced by PowerKit.ClientDelegatingHandler
  • Stripped local JsonExtensions.cs down to just EnumerateDescendantProperties (YouTube-specific recursive helper); all other methods replaced by JsonExtensions NuGet package (JsonExtensions.Reading)
  • Inlined SwapChars into SwapCipherOperation (only used in one place) and removed it from StringExtensions
  • Replaced verbose int/long/double/DateTimeOffset.TryParse(…, out var result) ? result : (T?)null ternaries with T.ParseOrNull(…) from PowerKit's type extensions across bridge and model files
  • Replaced .FirstOrDefault(s => !string.IsNullOrWhiteSpace(s)) with .WhereNotNullOrWhiteSpace().FirstOrDefault() in VideoWatchPage.cs
  • Removed redundant .NullIfWhiteSpace() calls that followed whitespace-filtering FirstOrDefault in VideoWatchPage.cs

Converter (YoutubeExplode.Converter)

  • Deleted AsyncCollectionExtensions.cs, GenericExtensions.cs, StringExtensions.cs — all covered by PowerKit
  • Deleted ProgressMuxer.cs — replaced by PowerKit.ProgressMuxer (now normalizes by weighted average, matching the local implementation)
  • Added PowerKit package reference; updated usings in Converter.cs, FFmpeg.cs, ConversionRequestBuilder.cs, ConversionExtensions.cs, LanguageExtensions.cs
  • Replaced Math.Clamp(value, 0, 1) with value.Clamp(0, 1) using PowerKit's ComparableExtensions in FFmpeg.cs

Test projects (YoutubeExplode.Tests, YoutubeExplode.Converter.Tests)

  • Deleted local TempFile.cs / TempDir.cs — replaced by PowerKit.TempFile / PowerKit.TempDirectory
  • Deleted FileExtensions.cs from YoutubeExplode.Converter.TestsFile.ContainsBytes replaced by File.Contains from PowerKit.Extensions
  • Deleted HttpExtensions.cs from YoutubeExplode.Converter.TestsDownloadAsync covered by PowerKit.Extensions.HttpClientExtensions
  • Added PowerKit package reference to both test projects; updated all call sites

GUI demo (YoutubeExplode.Demo.Gui)

  • Added PowerKit package reference; replaced Path.SanitizeFileName with Path.EscapeFileName
  • Deleted DelegateProgress.cs — replaced by PowerKit.DelegateProgress<T>

Package versions

  • PowerKit: updated to 0.0.0-a.9 (latest pre-release)
  • PolyShim: updated to 2.11.0-a.1 (latest pre-release)
  • JsonExtensions: 1.2.0 (runtime dependency, no PrivateAssets)

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 17, 2026

@copilot did you also check the other projects?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 17, 2026

@copilot did you also check the other projects?

Good catch — missed the YoutubeExplode.Converter project. It had its own copies of AsyncCollectionExtensions.cs, GenericExtensions.cs, and StringExtensions.cs that are all covered by PowerKit. Applied the same treatment there in aff922f: deleted those three files, added PowerKit to the project reference, and updated the using statements across Converter.cs, FFmpeg.cs, ConversionRequestBuilder.cs, ConversionExtensions.cs, and LanguageExtensions.cs.

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:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from Tyrrrz April 17, 2026 14:17
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 17, 2026

@copilot what about the test projects?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 17, 2026

@copilot what about the test projects?

Checked both YoutubeExplode.Tests and YoutubeExplode.Converter.Tests. Their utility/extension files are all unique and don't duplicate anything covered by PowerKit:

  • FileExtensions.csContainsBytes (custom binary search)
  • HttpExtensions.csDownloadAsync (HTTP download helper)
  • FFmpeg.cs, MediaFormat.cs, TempDir.cs, TempFile.cs — test infrastructure with no overlap

The two CopyToAsync calls in the test projects use the standard BCL overload (with CancellationToken), not the custom progress-based one from StreamExtensions.cs. No changes needed there.

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 17, 2026

@copilot TempDir/TempFile definitely exist in POwerKit

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 17, 2026

@copilot TempDir/TempFile definitely exist in POwerKit

Done in 1d0a035. Added PowerKit to both test projects, deleted the local TempFile.cs from YoutubeExplode.Tests and both TempFile.cs/TempDir.cs from YoutubeExplode.Converter.Tests, and updated all call sites to use PowerKit.TempFile and PowerKit.TempDirectory (note the rename from TempDirTempDirectory to match PowerKit's type name).

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 17, 2026

@copilot is SwapChars called more than in one place? If it's only used in one place, then inline it.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 17, 2026

@copilot is SwapChars called more than in one place? If it's only used in one place, then inline it.

It was only used in one place (SwapCipherOperation). Inlined in 16ea54e and removed SwapChars from StringExtensions.

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 17, 2026

If we added the JsonExtensions NuGet package, would we be able to remove most of this class?

https://github.com/Tyrrrz/YoutubeExplode/blob/copilot/add-powerkit-package/YoutubeExplode/Utils/Extensions/JsonExtensions.cs

@copilot

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 17, 2026

If we added the JsonExtensions NuGet package, would we be able to remove most of this class?

https://github.com/Tyrrrz/YoutubeExplode/blob/copilot/add-powerkit-package/YoutubeExplode/Utils/Extensio...

Yes — the JsonExtensions package covers 9 of the 10 methods: GetPropertyOrNull, GetBooleanOrNull, GetStringOrNull, GetInt32OrNull, GetInt64OrNull, EnumerateArrayOrNull, EnumerateArrayOrEmpty, EnumerateObjectOrNull, and EnumerateObjectOrEmpty. The only one that doesn't exist in the package is EnumerateDescendantProperties, which is a YouTube-specific recursive helper and needs to stay local.

Done in 4fe7e12: added JsonExtensions v1.2.0 (PrivateAssets="all") to Directory.Packages.props and YoutubeExplode.csproj, stripped the local JsonExtensions.cs down to just EnumerateDescendantProperties (which now calls into the package for its recursive helpers), and replaced using YoutubeExplode.Utils.Extensions with using JsonExtensions.Reading in all affected files.

Copilot AI changed the title Add PowerKit; remove duplicate local utilities/extensions Add PowerKit and JsonExtensions; remove duplicate local utilities/extensions Apr 17, 2026
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 18, 2026

@copilot ContainsBytes is now also available via File.Contains

Done in c9708c9. Updated PowerKit to 0.0.0-a.8, which adds File.Contains. Deleted FileExtensions.cs from YoutubeExplode.Converter.Tests and replaced all File.ContainsBytes(...) calls with File.Contains(...).

Also took the opportunity to remove two more local files that a.8 covers:

  • HttpExtensions.cs from YoutubeExplode.Converter.TestsDownloadAsync is in PowerKit.Extensions.HttpClientExtensions
  • ClientDelegatingHandler.cs from YoutubeExplode — the CS1587 bug in PowerKit's own content file is fixed in a.8, so the local copy and the NoWarn suppression are both gone

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:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 18, 2026

@copilot can you also do a pass over the codebase and check if it could benefit from using some of PowerKit's utilities/functions (or PolyShim's newer polyfills) that it's not using yet.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 18, 2026

@copilot can you also do a pass over the codebase and check if it could benefit from using some of PowerKit's utilities/functions (or PolyShim's newer polyfills) that it's not using yet.

Done in a205bcf. Here's what the pass found:

Replaced (local file deleted):

  • YoutubeExplode.Demo.Gui/Utils/DelegateProgress.csPowerKit.DelegateProgress<T> (identical implementation, already in package)

Replaced (verbose TryParse ternaries → ParseOrNull):
Every occurrence of the pattern T.TryParse(s, CultureInfo.InvariantCulture, out var result) ? result : (T?)null across 8 files was replaced with T.ParseOrNull(s, CultureInfo.InvariantCulture) using PowerKit's Int32Extensions, Int64Extensions, DoubleExtensions, and DateTimeOffsetExtensions:

  • VideoWatchPage.cslong.ParseOrNull ×3, DateTimeOffset.ParseOrNull ×2
  • PlayerResponse.csdouble.ParseOrNull ×1, long.ParseOrNull ×3
  • PlaylistVideoData.csdouble.ParseOrNull ×1
  • PlaylistBrowseResponse.csint.ParseOrNull ×2
  • PlaylistNextResponse.csint.ParseOrNull ×2
  • DashManifest.cslong.ParseOrNull ×1
  • ChannelClient.csint.ParseOrNull ×1
  • VideoQuality.csint.ParseOrNull ×1

Not replaceable:

  • YoutubeExplode.Converter/Utils/ProgressMuxer.cs — the local version normalizes by dividing by total weight (weightedSum / weightedMax), while PowerKit's sums raw weight * p values; they're functionally different when weights don't sum to 1 (which they don't in this codebase)
  • TimeSpan.TryParseExact calls in SearchResponse.cs — PowerKit only has TryParse-based ParseOrNull, not TryParseExact with a format array

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:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll get(&#39;libraries&#39;,{}); [print(k,v.get(&#39;path&#39;,&#39;&#39;)) for k,v in libs.items() if &#39;powerkit&#39; in k.lowerbash (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 18, 2026

@copilot any obvious refactorings that can be done with the newly added NullIfWhiteSpace, Pipe, etc?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 18, 2026

@copilot any obvious refactorings that can be done with the newly added NullIfWhiteSpace, Pipe, etc?

Done in 71a7b9f. The most obvious cleanup was in VideoWatchPage.cs: both PlayerConfig and PlayerResponse had a redundant .NullIfWhiteSpace() call immediately after .FirstOrDefault(s => !string.IsNullOrWhiteSpace(s)). Since FirstOrDefault already guarantees the returned value is non-whitespace (or null when no match), the subsequent NullIfWhiteSpace() was a no-op and has been removed.

The rest of the codebase was already making good use of Pipe, NullIfWhiteSpace, SubstringAfter/SubstringUntil, WhereNotNull, FirstOrNull, and ElementAtOrNull — no further low-hanging fruit found.

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 18, 2026

@copilot any other PowerKit-provided extensions/utilities that might be useful?

@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 18, 2026

@copilot update PowerKit, it adds some new APIs that may be useful to YoutubeExplode

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 18, 2026

@copilot any other PowerKit-provided extensions/utilities that might be useful?

Done in 01a09c9. Two more improvements applied:

  • VideoWatchPage.cs (×2): .FirstOrDefault(s => !string.IsNullOrWhiteSpace(s)).WhereNotNullOrWhiteSpace().FirstOrDefault() using PowerKit's EnumerableExtensions
  • FFmpeg.cs: Math.Clamp(value, 0, 1)(value).Clamp(0, 1) using PowerKit's ComparableExtensions

Everything else already uses the relevant PowerKit APIs (Pipe, NullIfWhiteSpace, SubstringAfter/SubstringUntil, WhereNotNull, ParseOrNull, Reverse, etc.). The local ProgressMuxer in the Converter can't be replaced by PowerKit's — it normalizes by dividing by total weight, while PowerKit's simply sums weighted values, which would give the wrong output when weights don't sum to 1.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 18, 2026

@copilot update PowerKit, it adds some new APIs that may be useful to YoutubeExplode

Done in ad9bdd5. Updated to 0.0.0-a.9.

The most significant new addition is ProgressMuxer — it now normalizes by weightedSum / totalWeight (weighted average), which matches our local implementation exactly. Deleted YoutubeExplode.Converter/Utils/ProgressMuxer.cs and replaced the import with using PowerKit; in Converter.cs.

The other new files (Cell, Disposable, LockFile, Observable, SynchronizedObserver, various new extension files) don't have applicable use cases in the current codebase.

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:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Tyrrrz Tyrrrz marked this pull request as ready for review April 18, 2026 15:17
Copilot AI review requested due to automatic review settings April 18, 2026 15:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates duplicated internal utility/extension code across the solution by switching call sites to the PowerKit and JsonExtensions NuGet packages, and removes the now-redundant local implementations.

Changes:

  • Replaced many local Utils/Extensions helpers with PowerKit.Extensions / JsonExtensions.Reading and deleted the corresponding local source files.
  • Updated parsing/call-site code to use PowerKit helpers (e.g., ParseOrNull, Clamp, whitespace filters).
  • Updated central package versions (incl. new PowerKit / JsonExtensions references and prerelease bumps).

Reviewed changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
YoutubeExplode/YoutubeHttpHandler.cs Switches hashing + handler base to PowerKit-based helpers.
YoutubeExplode/YoutubeExplode.csproj Adds JsonExtensions and PowerKit package refs for the main library.
YoutubeExplode/Videos/VideoId.cs Moves extension usage to PowerKit.
YoutubeExplode/Videos/VideoController.cs Moves JSON reading helpers to JsonExtensions.Reading.
YoutubeExplode/Videos/Streams/VideoQuality.cs Uses PowerKit parsing helpers.
YoutubeExplode/Videos/Streams/StreamClient.cs Moves extension usage to PowerKit.
YoutubeExplode/Videos/ClosedCaptions/ClosedCaptionController.cs Moves extension usage to PowerKit.
YoutubeExplode/Videos/ClosedCaptions/ClosedCaptionClient.cs Moves extension usage to PowerKit.
YoutubeExplode/Utils/Xml.cs Uses PowerKit XElement extensions.
YoutubeExplode/Utils/UrlEx.cs Uses PowerKit extensions.
YoutubeExplode/Utils/Hash.cs Removes local hash helper.
YoutubeExplode/Utils/Extensions/XElementExtensions.cs Removes local XML namespace stripping extension.
YoutubeExplode/Utils/Extensions/UriExtensions.cs Removes local URI domain extension.
YoutubeExplode/Utils/Extensions/StringExtensions.cs Removes duplicated string helpers, keeps only StripNonDigit.
YoutubeExplode/Utils/Extensions/StreamExtensions.cs Removes local stream progress copy helper.
YoutubeExplode/Utils/Extensions/JsonExtensions.cs Keeps only YouTube-specific recursive JSON search; relies on JsonExtensions for the rest.
YoutubeExplode/Utils/Extensions/HttpExtensions.cs Removes local HTTP request cloning / HEAD helper.
YoutubeExplode/Utils/Extensions/GenericExtensions.cs Removes local Pipe helper (covered by PowerKit).
YoutubeExplode/Utils/Extensions/CollectionExtensions.cs Removes local collection helpers (covered by PowerKit).
YoutubeExplode/Utils/Extensions/AsyncCollectionExtensions.cs Removes local async enumerable helpers (covered by PowerKit).
YoutubeExplode/Utils/ClientDelegatingHandler.cs Removes local delegating handler (replaced by PowerKit).
YoutubeExplode/Search/SearchClient.cs Moves extension usage to PowerKit.
YoutubeExplode/Playlists/PlaylistId.cs Moves extension usage to PowerKit.
YoutubeExplode/Common/IBatchItem.cs Moves async enumerable helpers to PowerKit.
YoutubeExplode/Common/Batch.cs Moves extension usage to PowerKit.
YoutubeExplode/Channels/UserName.cs Moves extension usage to PowerKit.
YoutubeExplode/Channels/ChannelSlug.cs Moves extension usage to PowerKit.
YoutubeExplode/Channels/ChannelId.cs Moves extension usage to PowerKit.
YoutubeExplode/Channels/ChannelHandle.cs Moves extension usage to PowerKit.
YoutubeExplode/Channels/ChannelClient.cs Uses PowerKit parsing helpers.
YoutubeExplode/Bridge/VideoWatchPage.cs Uses JsonExtensions + PowerKit parsing/whitespace helpers.
YoutubeExplode/Bridge/ThumbnailData.cs Moves JSON reading helpers to JsonExtensions.
YoutubeExplode/Bridge/SearchResponse.cs Uses JsonExtensions + PowerKit helpers in search response model parsing.
YoutubeExplode/Bridge/PlaylistVideoData.cs Uses JsonExtensions + PowerKit parsing helpers.
YoutubeExplode/Bridge/PlaylistNextResponse.cs Uses JsonExtensions + PowerKit parsing helpers.
YoutubeExplode/Bridge/PlaylistBrowseResponse.cs Uses JsonExtensions + PowerKit parsing helpers.
YoutubeExplode/Bridge/PlayerSource.cs Moves extension usage to PowerKit.
YoutubeExplode/Bridge/PlayerResponse.cs Uses JsonExtensions + PowerKit parsing helpers.
YoutubeExplode/Bridge/DashManifest.cs Uses PowerKit parsing helpers.
YoutubeExplode/Bridge/ClosedCaptionTrackResponse.cs Uses PowerKit XElement/string helpers.
YoutubeExplode/Bridge/Cipher/SwapCipherOperation.cs Inlines swap logic instead of using removed string helper.
YoutubeExplode/Bridge/Cipher/ReverseCipherOperation.cs Uses PowerKit string reverse extension.
YoutubeExplode/Bridge/ChannelPage.cs Moves extension usage to PowerKit.
YoutubeExplode.Tests/YoutubeExplode.Tests.csproj Adds PowerKit for temp file/dir utilities used by tests.
YoutubeExplode.Tests/Utils/TempFile.cs Removes local temp file helper (replaced by PowerKit).
YoutubeExplode.Tests/StreamSpecs.cs Switches temp file usage to PowerKit.
YoutubeExplode.Tests/ClosedCaptionSpecs.cs Switches temp file usage to PowerKit.
YoutubeExplode.Demo.Gui/YoutubeExplode.Demo.Gui.csproj Adds PowerKit dependency for GUI demo utilities.
YoutubeExplode.Demo.Gui/ViewModels/MainViewModel.cs Switches filename sanitization and progress helper to PowerKit.
YoutubeExplode.Demo.Gui/Utils/Extensions/PathExtensions.cs Removes local path sanitization helper.
YoutubeExplode.Demo.Gui/Utils/DelegateProgress.cs Removes local progress implementation (replaced by PowerKit).
YoutubeExplode.Converter/YoutubeExplode.Converter.csproj Adds PowerKit for converter utilities.
YoutubeExplode.Converter/Utils/ProgressMuxer.cs Removes local progress muxer (replaced by PowerKit).
YoutubeExplode.Converter/Utils/Extensions/StringExtensions.cs Removes local string extensions (covered by PowerKit).
YoutubeExplode.Converter/Utils/Extensions/LanguageExtensions.cs Moves extension usage to PowerKit.
YoutubeExplode.Converter/Utils/Extensions/GenericExtensions.cs Removes local Pipe helper (covered by PowerKit).
YoutubeExplode.Converter/Utils/Extensions/AsyncCollectionExtensions.cs Removes local async enumerable helpers (covered by PowerKit).
YoutubeExplode.Converter/FFmpeg.cs Uses PowerKit Clamp extension.
YoutubeExplode.Converter/Converter.cs Uses PowerKit helpers for language code selection.
YoutubeExplode.Converter/ConversionRequestBuilder.cs Moves extension usage to PowerKit.
YoutubeExplode.Converter/ConversionExtensions.cs Moves extension usage to PowerKit.
YoutubeExplode.Converter.Tests/YoutubeExplode.Converter.Tests.csproj Adds PowerKit for temp dirs/files and file/HTTP helpers in tests.
YoutubeExplode.Converter.Tests/Utils/TempFile.cs Removes local temp file helper (replaced by PowerKit).
YoutubeExplode.Converter.Tests/Utils/TempDir.cs Removes local temp dir helper (replaced by PowerKit).
YoutubeExplode.Converter.Tests/Utils/FFmpeg.cs Switches helper usage to PowerKit.
YoutubeExplode.Converter.Tests/Utils/Extensions/HttpExtensions.cs Removes local download helper (replaced by PowerKit).
YoutubeExplode.Converter.Tests/Utils/Extensions/FileExtensions.cs Removes local file-bytes helper (replaced by PowerKit).
YoutubeExplode.Converter.Tests/SubtitleSpecs.cs Switches temp dir + file content checks to PowerKit.
YoutubeExplode.Converter.Tests/GeneralSpecs.cs Switches temp dir + file content checks to PowerKit.
YoutubeExplode.Converter.Tests/EnvironmentSpecs.cs Switches temp dir helper to PowerKit.
Directory.Packages.props Adds/updates central versions for JsonExtensions/PowerKit and bumps prerelease package versions.
Comments suppressed due to low confidence (1)

YoutubeExplode/Bridge/SearchResponse.cs:42

  • Same null-propagation issue as Videos: ContentRoot?.EnumerateDescendantProperties(...) may be null, but .Select(...) / .ToArray() are called unconditionally. This can throw before the ?? fallback is reached. Add null-propagation on the LINQ chain or coalesce to an empty sequence earlier.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread YoutubeExplode/Bridge/PlayerResponse.cs
Comment thread YoutubeExplode/Bridge/PlayerResponse.cs
Comment thread YoutubeExplode.Converter/YoutubeExplode.Converter.csproj
Comment thread YoutubeExplode/YoutubeHttpHandler.cs
Comment thread YoutubeExplode/Bridge/SearchResponse.cs
Comment thread YoutubeExplode/Bridge/PlaylistNextResponse.cs
Comment thread YoutubeExplode/Bridge/PlayerResponse.cs
Comment thread YoutubeExplode/YoutubeExplode.csproj
Comment thread YoutubeExplode/Bridge/SearchResponse.cs
Comment thread YoutubeExplode/Bridge/SearchResponse.cs
@Tyrrrz Tyrrrz merged commit 4378a9c into prime Apr 18, 2026
11 checks passed
@Tyrrrz Tyrrrz deleted the copilot/add-powerkit-package branch April 18, 2026 16:09
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (34ac6a9) to head (ad9bdd5).
⚠️ Report is 1 commits behind head on prime.

Additional details and impacted files
@@     Coverage Diff      @@
##   prime   #948   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants