Skip to content

Commit

Permalink
Jellyfin 增加 IsSubtitleFile 方法
Browse files Browse the repository at this point in the history
  • Loading branch information
JavScraper committed Jun 22, 2021
1 parent 613451d commit 861dc69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Emby.Plugins.JavScraper/Extensions/JellyfinExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ namespace Emby.Plugins.JavScraper
{
public static class JellyfinExtensions
{
private static string[] SubtitleExtensions = new[] { ".srt", ".ssa", ".ass", ".sub", ".smi", ".sami", ".vtt", ".mpl" };

public static bool IsSubtitleFile(this ILibraryManager _, string path)
{
var extension = Path.GetExtension(path);
return ListHelper.ContainsIgnoreCase(SubtitleExtensions, extension);
}

public static void UpdateToRepository(this BaseItem item, ItemUpdateType type)
=> item.UpdateToRepository(type, default);

Expand Down

0 comments on commit 861dc69

Please sign in to comment.