diff --git a/YoutubeExplode.Tests/PlaylistSpecs.cs b/YoutubeExplode.Tests/PlaylistSpecs.cs index 5772a62d..e411e641 100644 --- a/YoutubeExplode.Tests/PlaylistSpecs.cs +++ b/YoutubeExplode.Tests/PlaylistSpecs.cs @@ -100,8 +100,7 @@ public async Task I_can_get_videos_included_in_a_playlist() .Select(v => v.Id.Value) .Should() .Contain( - new[] - { + [ "uPZSSdkGQhM", "fi0w57kr_jY", "xLJt5A-NeQI", @@ -123,7 +122,7 @@ public async Task I_can_get_videos_included_in_a_playlist() "8Kg-8ZjgLAQ", "E9zfpKsw6f8", "eBCw9sC5D40" - } + ] ); } @@ -142,8 +141,7 @@ public async Task I_can_get_videos_included_in_a_large_playlist() .Select(v => v.Id.Value) .Should() .Contain( - new[] - { + [ "RBumgq5yVrA", "kN0iD0pI3o0", "YqB8Dm65X18", @@ -153,7 +151,7 @@ public async Task I_can_get_videos_included_in_a_large_playlist() "x-IR7PtA7RA", "N-8E9mHxDy0", "5ly88Ju1N6A" - } + ] ); } diff --git a/YoutubeExplode/Bridge/PlaylistVideoData.cs b/YoutubeExplode/Bridge/PlaylistVideoData.cs index 74eefe23..2c61dced 100644 --- a/YoutubeExplode/Bridge/PlaylistVideoData.cs +++ b/YoutubeExplode/Bridge/PlaylistVideoData.cs @@ -66,7 +66,7 @@ internal class PlaylistVideoData(JsonElement content) .GetPropertyOrNull("lengthText") ?.GetPropertyOrNull("simpleText") ?.GetStringOrNull() - ?.ParseTimeSpanOrNull(new[] { @"m\:ss", @"mm\:ss", @"h\:mm\:ss", @"hh\:mm\:ss" }) + ?.ParseTimeSpanOrNull([@"m\:ss", @"mm\:ss", @"h\:mm\:ss", @"hh\:mm\:ss"]) ?? content .GetPropertyOrNull("lengthText") ?.GetPropertyOrNull("runs") @@ -74,7 +74,7 @@ internal class PlaylistVideoData(JsonElement content) ?.Select(j => j.GetPropertyOrNull("text")?.GetStringOrNull()) .WhereNotNull() .ConcatToString() - .ParseTimeSpanOrNull(new[] { @"m\:ss", @"mm\:ss", @"h\:mm\:ss", @"hh\:mm\:ss" }); + .ParseTimeSpanOrNull([@"m\:ss", @"mm\:ss", @"h\:mm\:ss", @"hh\:mm\:ss"]); [Lazy] public IReadOnlyList Thumbnails => diff --git a/YoutubeExplode/Bridge/SearchResponse.cs b/YoutubeExplode/Bridge/SearchResponse.cs index 03273da7..fb8a47ae 100644 --- a/YoutubeExplode/Bridge/SearchResponse.cs +++ b/YoutubeExplode/Bridge/SearchResponse.cs @@ -96,7 +96,7 @@ internal class VideoData(JsonElement content) .GetPropertyOrNull("lengthText") ?.GetPropertyOrNull("simpleText") ?.GetStringOrNull() - ?.ParseTimeSpanOrNull(new[] { @"m\:ss", @"mm\:ss", @"h\:mm\:ss", @"hh\:mm\:ss" }) + ?.ParseTimeSpanOrNull([@"m\:ss", @"mm\:ss", @"h\:mm\:ss", @"hh\:mm\:ss"]) ?? content .GetPropertyOrNull("lengthText") ?.GetPropertyOrNull("runs") @@ -104,7 +104,7 @@ internal class VideoData(JsonElement content) ?.Select(j => j.GetPropertyOrNull("text")?.GetStringOrNull()) .WhereNotNull() .ConcatToString() - .ParseTimeSpanOrNull(new[] { @"m\:ss", @"mm\:ss", @"h\:mm\:ss", @"hh\:mm\:ss" }); + .ParseTimeSpanOrNull([@"m\:ss", @"mm\:ss", @"h\:mm\:ss", @"hh\:mm\:ss"]); [Lazy] public IReadOnlyList Thumbnails => diff --git a/YoutubeExplode/Channels/ChannelClient.cs b/YoutubeExplode/Channels/ChannelClient.cs index 0f347c1c..76a9c367 100644 --- a/YoutubeExplode/Channels/ChannelClient.cs +++ b/YoutubeExplode/Channels/ChannelClient.cs @@ -71,13 +71,12 @@ public async ValueTask GetAsync( return new Channel( "UCuVPpxrm2VAgpH3Ktln4HXg", "Movies & TV", - new[] - { + [ new Thumbnail( "https://www.gstatic.com/youtube/img/tvfilm/clapperboard_profile.png", new Resolution(1024, 1024) ) - } + ] ); } diff --git a/YoutubeExplode/Common/Thumbnail.cs b/YoutubeExplode/Common/Thumbnail.cs index 691ad8bf..ccaab477 100644 --- a/YoutubeExplode/Common/Thumbnail.cs +++ b/YoutubeExplode/Common/Thumbnail.cs @@ -38,8 +38,7 @@ public Thumbnail(string url, Resolution resolution) public partial class Thumbnail { internal static IReadOnlyList GetDefaultSet(VideoId videoId) => - new[] - { + [ new Thumbnail( $"https://img.youtube.com/vi/{videoId}/default.jpg", new Resolution(120, 90) @@ -52,7 +51,7 @@ internal static IReadOnlyList GetDefaultSet(VideoId videoId) => $"https://img.youtube.com/vi/{videoId}/hqdefault.jpg", new Resolution(480, 360) ) - }; + ]; } ///