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