mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-07 16:28:56 +01:00
Merge branch 'master' into warn17
This commit is contained in:
@@ -16,12 +16,23 @@ namespace MediaBrowser.Common.Extensions
|
||||
/// <param name="list">The list that should get shuffled.</param>
|
||||
/// <typeparam name="T">The type.</typeparam>
|
||||
public static void Shuffle<T>(this IList<T> list)
|
||||
{
|
||||
list.Shuffle(_rng);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuffles the items in a list.
|
||||
/// </summary>
|
||||
/// <param name="list">The list that should get shuffled.</param>
|
||||
/// <param name="rng">The random number generator to use.</param>
|
||||
/// <typeparam name="T">The type.</typeparam>
|
||||
public static void Shuffle<T>(this IList<T> list, Random rng)
|
||||
{
|
||||
int n = list.Count;
|
||||
while (n > 1)
|
||||
{
|
||||
n--;
|
||||
int k = _rng.Next(n + 1);
|
||||
int k = rng.Next(n + 1);
|
||||
T value = list[k];
|
||||
list[k] = list[n];
|
||||
list[n] = value;
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Model.Updates;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace MediaBrowser.Common
|
||||
@@ -121,11 +122,12 @@ namespace MediaBrowser.Common
|
||||
void RemovePlugin(IPlugin plugin);
|
||||
|
||||
/// <summary>
|
||||
/// Inits this instance.
|
||||
/// Initializes this instance.
|
||||
/// </summary>
|
||||
/// <param name="serviceCollection">The service collection.</param>
|
||||
/// <param name="startupConfig">The configuration to use for initialization.</param>
|
||||
/// <returns>A task.</returns>
|
||||
Task InitAsync(IServiceCollection serviceCollection);
|
||||
Task InitAsync(IServiceCollection serviceCollection, IConfiguration startupConfig);
|
||||
|
||||
/// <summary>
|
||||
/// Creates the instance.
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.2.8" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user