mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-21 06:20:34 -04:00
Using immuable collections in the file extensions class
This commit is contained in:
parent
bb5dc0dcae
commit
fd37cede9d
@ -32,6 +32,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
|
||||||
<ProjectReference Include="../Kyoo.Common/Kyoo.Common.csproj" />
|
<ProjectReference Include="../Kyoo.Common/Kyoo.Common.csproj" />
|
||||||
<ProjectReference Include="../Kyoo.CommonAPI/Kyoo.CommonAPI.csproj" />
|
<ProjectReference Include="../Kyoo.CommonAPI/Kyoo.CommonAPI.csproj" />
|
||||||
<PackageReference Include="Autofac" Version="6.2.0" />
|
<PackageReference Include="Autofac" Version="6.2.0" />
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.Immutable;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Kyoo.Models.Watch
|
namespace Kyoo.Models.Watch
|
||||||
{
|
{
|
||||||
@ -12,7 +12,7 @@ namespace Kyoo.Models.Watch
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The list of known video extensions
|
/// The list of known video extensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly string[] VideoExtensions =
|
public static readonly ImmutableArray<string> VideoExtensions = new()
|
||||||
{
|
{
|
||||||
".webm",
|
".webm",
|
||||||
".mkv",
|
".mkv",
|
||||||
@ -53,11 +53,11 @@ namespace Kyoo.Models.Watch
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The dictionary of known subtitles extensions and the name of the subtitle codec.
|
/// The dictionary of known subtitles extensions and the name of the subtitle codec.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly Dictionary<string, string> SubtitleExtensions = new()
|
public static readonly ImmutableDictionary<string, string> SubtitleExtensions = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{".ass", "ass"},
|
{".ass", "ass"},
|
||||||
{".str", "subrip"}
|
{".str", "subrip"}
|
||||||
};
|
}.ToImmutableDictionary();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check if a file represent a subtitle file (only by checking the extension of the file)
|
/// Check if a file represent a subtitle file (only by checking the extension of the file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user