rework scheduled tasks in preparation of common project going portable

This commit is contained in:
Luke Pulverenti
2016-10-23 15:14:57 -04:00
parent 4829683402
commit 07791d46a5
78 changed files with 500 additions and 411 deletions

View File

@@ -1,9 +1,7 @@
using System;
using System.Globalization;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using MediaBrowser.Model.Cryptography;
namespace MediaBrowser.Common.Extensions
{
@@ -12,6 +10,7 @@ namespace MediaBrowser.Common.Extensions
/// </summary>
public static class BaseExtensions
{
public static ICryptographyProvider CryptographyProvider { get; set; }
/// <summary>
/// Strips the HTML.
@@ -26,15 +25,6 @@ namespace MediaBrowser.Common.Extensions
return Regex.Replace(htmlString, pattern, string.Empty).Trim();
}
public static string RemoveDiacritics(this string text)
{
return String.Concat(
text.Normalize(NormalizationForm.FormD)
.Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) !=
UnicodeCategory.NonSpacingMark)
).Normalize(NormalizationForm.FormC);
}
/// <summary>
/// Gets the M d5.
/// </summary>
@@ -42,10 +32,7 @@ namespace MediaBrowser.Common.Extensions
/// <returns>Guid.</returns>
public static Guid GetMD5(this string str)
{
using (var provider = MD5.Create())
{
return new Guid(provider.ComputeHash(Encoding.Unicode.GetBytes(str)));
}
return CryptographyProvider.GetMD5(str);
}
/// <summary>