mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
Fix multiple mistakes and warnings
This commit is contained in:
@@ -14,20 +14,20 @@ namespace MediaBrowser.Common.Extensions
|
||||
/// Strips the HTML.
|
||||
/// </summary>
|
||||
/// <param name="htmlString">The HTML string.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
/// <returns><see cref="string" />.</returns>
|
||||
public static string StripHtml(this string htmlString)
|
||||
{
|
||||
// http://stackoverflow.com/questions/1349023/how-can-i-strip-html-from-text-in-net
|
||||
const string pattern = @"<(.|\n)*?>";
|
||||
const string Pattern = @"<(.|\n)*?>";
|
||||
|
||||
return Regex.Replace(htmlString, pattern, string.Empty).Trim();
|
||||
return Regex.Replace(htmlString, Pattern, string.Empty).Trim();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the M d5.
|
||||
/// Gets the Md5.
|
||||
/// </summary>
|
||||
/// <param name="str">The STR.</param>
|
||||
/// <returns>Guid.</returns>
|
||||
/// <param name="str">The string.</param>
|
||||
/// <returns><see cref="Guid" />.</returns>
|
||||
public static Guid GetMD5(this string str)
|
||||
{
|
||||
using (var provider = MD5.Create())
|
||||
|
||||
@@ -5,13 +5,28 @@ namespace MediaBrowser.Common.Extensions
|
||||
// The MS CollectionExtensions are only available in netcoreapp
|
||||
public static class CollectionExtensions
|
||||
{
|
||||
public static TValue GetValueOrDefault<TKey, TValue> (this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key)
|
||||
public static TValue GetValueOrDefault<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, TKey key)
|
||||
{
|
||||
dictionary.TryGetValue(key, out var ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
// REVIEW: Inline?
|
||||
/// <summary>
|
||||
/// Copies all the elements of the current collection to the specified list
|
||||
/// starting at the specified destination array index. The index is specified as a 32-bit integer.
|
||||
/// </summary>
|
||||
/// <param name="source">The current collection that is the source of the elements.</param>
|
||||
/// <param name="destination">The list that is the destination of the elements copied from the current collection.</param>
|
||||
/// <param name="index">A 32-bit integer that represents the index in <c>destination</c> at which copying begins.</param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public static void CopyTo<T>(this IReadOnlyList<T> source, IList<T> destination, int index = 0)
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
destination[index + i] = source[i];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copies all the elements of the current collection to the specified list
|
||||
/// starting at the specified destination array index. The index is specified as a 32-bit integer.
|
||||
|
||||
Reference in New Issue
Block a user