From dcb54c1f6e4d3beb2ac2e0e52a2b13fa766b5fb0 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Thu, 14 Jul 2022 02:18:19 +0200 Subject: [PATCH] Inherit from `OEmbedProviderBase` in OEmbed providers (#12379) * Use OEmbedProviderBase * Use QueryHelpers.AddQueryString in .NET Core * Nullable value * Cleanup usings * Ensure invariant string * No need to URL encode when using QueryHelpers.AddQueryString() * Include WebUtilities * Cleanup usings * Revert "Include WebUtilities" This reverts commit 3cffb740cee8f11bd83cd6e753fba1a04575e5d2. * Revert "No need to URL encode when using QueryHelpers.AddQueryString()" This reverts commit 70ca5306ac9343c8825dba48ebd75180b5fd0ecf. * Revert "Ensure invariant string" This reverts commit 318ab23f6f2c4605308d767a4e65e7ceb286cebe. * Revert "Nullable value" This reverts commit c39911de06812620a08800a1cb72e1197d9972cc. * Revert to StringBuilder * Cleanup usings * Add more descriptions of providers --- src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/Flickr.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/Giphy.cs | 3 +-- src/Umbraco.Core/Media/EmbedProviders/Hulu.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/Issuu.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/Ted.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/Twitter.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs | 6 ++++-- src/Umbraco.Core/Media/EmbedProviders/Youtube.cs | 6 ++++-- 13 files changed, 49 insertions(+), 26 deletions(-) diff --git a/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs b/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs index 3ea329abec..3953fdd2b7 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/DailyMotion.cs @@ -3,8 +3,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO (V10): change base class to OEmbedProviderBase -public class DailyMotion : EmbedProviderBase +/// +/// Embed Provider for Dailymotion the popular online video-sharing platform. +/// +public class DailyMotion : OEmbedProviderBase { public DailyMotion(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs b/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs index 5e11780645..7738981fe9 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Flickr.cs @@ -4,8 +4,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class Flickr : EmbedProviderBase +/// +/// Embed Provider for Flickr the popular online image hosting and video hosting service. +/// +public class Flickr : OEmbedProviderBase { public Flickr(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs b/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs index 53d13cc063..5341580967 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/GettyImages.cs @@ -2,8 +2,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class GettyImages : EmbedProviderBase +/// +/// Embed Provider for Getty Images supplier of stock images, editorial photography, video and music for business and consumers. +/// +public class GettyImages : OEmbedProviderBase { public GettyImages(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs b/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs index 4adb02f8fb..a7fde54f18 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Giphy.cs @@ -5,8 +5,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders; /// /// Embed Provider for Giphy.com the popular online GIFs and animated sticker provider. /// -/// TODO(V10) : change base class to OEmbedProviderBase -public class Giphy : EmbedProviderBase +public class Giphy : OEmbedProviderBase { public Giphy(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs b/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs index 2fdadee6ea..85c1214fd1 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Hulu.cs @@ -2,8 +2,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class Hulu : EmbedProviderBase +/// +/// Embed Provider for Hulu the the popular online subscription streaming service. +/// +public class Hulu : OEmbedProviderBase { public Hulu(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs b/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs index ded01ef0d9..1a53ad88d1 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Issuu.cs @@ -3,8 +3,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class Issuu : EmbedProviderBase +/// +/// Embed Provider for Issuu the popular platform to create interactive flipbooks, social media posts, GIFs, and more from a single piece of static content. +/// +public class Issuu : OEmbedProviderBase { public Issuu(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs b/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs index 4e3f5b6731..daf1cc25f9 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Kickstarter.cs @@ -2,8 +2,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class Kickstarter : EmbedProviderBase +/// +/// Embed Provider for Kickstarter the popular online crowdfunding platform focused on creativity. +/// +public class Kickstarter : OEmbedProviderBase { public Kickstarter(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs b/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs index f00e631d25..33802fa059 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Slideshare.cs @@ -3,8 +3,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class Slideshare : EmbedProviderBase +/// +/// Embed Provider for SlideShare for professional online content including presentations, infographics, documents, and videos. +/// +public class Slideshare : OEmbedProviderBase { public Slideshare(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs b/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs index f3d4e2caae..2d59031b63 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/SoundCloud.cs @@ -3,8 +3,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class Soundcloud : EmbedProviderBase +/// +/// Embed Provider for SoundCloud the popular online audio distribution platform and music sharing provider. +/// +public class Soundcloud : OEmbedProviderBase { public Soundcloud(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Ted.cs b/src/Umbraco.Core/Media/EmbedProviders/Ted.cs index 9c8a607e13..5fcc7fcb42 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Ted.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Ted.cs @@ -3,8 +3,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class Ted : EmbedProviderBase +/// +/// Embed Provider for Ted that posts talks online for free distribution. +/// +public class Ted : OEmbedProviderBase { public Ted(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs b/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs index 555224032a..81aeb36491 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Twitter.cs @@ -2,8 +2,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class Twitter : EmbedProviderBase +/// +/// Embed Provider for Twitter the popular online service for microblogging and social networking. +/// +public class Twitter : OEmbedProviderBase { public Twitter(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs b/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs index ed3990ba4d..e4d19d463a 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Vimeo.cs @@ -3,8 +3,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class Vimeo : EmbedProviderBase +/// +/// Embed Provider for Vimeo the popular online video hosting, sharing, and services platform provider. +/// +public class Vimeo : OEmbedProviderBase { public Vimeo(IJsonSerializer jsonSerializer) : base(jsonSerializer) diff --git a/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs b/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs index 594c7ead83..30cf2e6016 100644 --- a/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs +++ b/src/Umbraco.Core/Media/EmbedProviders/Youtube.cs @@ -2,8 +2,10 @@ using Umbraco.Cms.Core.Serialization; namespace Umbraco.Cms.Core.Media.EmbedProviders; -// TODO(V10) : change base class to OEmbedProviderBase -public class YouTube : EmbedProviderBase +/// +/// Embed Provider for YouTube the popular online video sharing and social media platform provider. +/// +public class YouTube : OEmbedProviderBase { public YouTube(IJsonSerializer jsonSerializer) : base(jsonSerializer)