mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-20 05:04:18 +01:00
Switched all i/o to win32 methods and added protobuf serialization for ffprobe caching
This commit is contained in:
parent
882e364326
commit
c80c8c1cfd
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.Composition;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Events;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
@@ -23,11 +24,9 @@ namespace MediaBrowser.TV.Providers
|
||||
|
||||
public override Task FetchAsync(BaseEntity item, ItemResolveEventArgs args)
|
||||
{
|
||||
var metadataFile = args.GetFileSystemEntryByName("series.xml");
|
||||
|
||||
if (metadataFile.HasValue)
|
||||
if (args.ContainsFile("series.xml"))
|
||||
{
|
||||
return Task.Run(() => { new SeriesXmlParser().Fetch(item as Series, metadataFile.Value.Path); });
|
||||
return Task.Run(() => { new SeriesXmlParser().Fetch(item as Series, Path.Combine(args.Path, "series.xml")); });
|
||||
}
|
||||
|
||||
return Task.FromResult<object>(null);
|
||||
|
||||
@@ -20,9 +20,7 @@ namespace MediaBrowser.TV.Resolvers
|
||||
return null;
|
||||
}
|
||||
|
||||
var metadataFile = args.GetFileSystemEntryByName("series.xml");
|
||||
|
||||
if (metadataFile.HasValue || Path.GetFileName(args.Path).IndexOf("[tvdbid=", StringComparison.OrdinalIgnoreCase) != -1 || TVUtils.IsSeriesFolder(args.Path, args.FileSystemChildren))
|
||||
if (args.ContainsFile("series.xml") || Path.GetFileName(args.Path).IndexOf("[tvdbid=", StringComparison.OrdinalIgnoreCase) != -1 || TVUtils.IsSeriesFolder(args.Path, args.FileSystemChildren))
|
||||
{
|
||||
return new Series();
|
||||
}
|
||||
|
||||
@@ -51,13 +51,13 @@ namespace MediaBrowser.TV
|
||||
return seasonPathExpressions.Any(r => r.IsMatch(path));
|
||||
}
|
||||
|
||||
public static bool IsSeriesFolder(string path, LazyFileInfo[] fileSystemChildren)
|
||||
public static bool IsSeriesFolder(string path, WIN32_FIND_DATA[] fileSystemChildren)
|
||||
{
|
||||
for (int i = 0; i < fileSystemChildren.Length; i++)
|
||||
{
|
||||
var child = fileSystemChildren[i];
|
||||
|
||||
if (child.FileInfo.IsDirectory)
|
||||
if (child.IsDirectory)
|
||||
{
|
||||
if (IsSeasonFolder(child.Path))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user