mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
Add some analyzers to MediaBrowser.MediaEncoding
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using BDInfo.IO;
|
||||
@@ -5,7 +7,7 @@ using MediaBrowser.Model.IO;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.BdInfo
|
||||
{
|
||||
class BdInfoDirectoryInfo : IDirectoryInfo
|
||||
public class BdInfoDirectoryInfo : IDirectoryInfo
|
||||
{
|
||||
private readonly IFileSystem _fileSystem = null;
|
||||
|
||||
@@ -43,25 +45,32 @@ namespace MediaBrowser.MediaEncoding.BdInfo
|
||||
|
||||
public IDirectoryInfo[] GetDirectories()
|
||||
{
|
||||
return Array.ConvertAll(_fileSystem.GetDirectories(_impl.FullName).ToArray(),
|
||||
return Array.ConvertAll(
|
||||
_fileSystem.GetDirectories(_impl.FullName).ToArray(),
|
||||
x => new BdInfoDirectoryInfo(_fileSystem, x));
|
||||
}
|
||||
|
||||
public IFileInfo[] GetFiles()
|
||||
{
|
||||
return Array.ConvertAll(_fileSystem.GetFiles(_impl.FullName).ToArray(),
|
||||
return Array.ConvertAll(
|
||||
_fileSystem.GetFiles(_impl.FullName).ToArray(),
|
||||
x => new BdInfoFileInfo(x));
|
||||
}
|
||||
|
||||
public IFileInfo[] GetFiles(string searchPattern)
|
||||
{
|
||||
return Array.ConvertAll(_fileSystem.GetFiles(_impl.FullName, new[] { searchPattern }, false, false).ToArray(),
|
||||
return Array.ConvertAll(
|
||||
_fileSystem.GetFiles(_impl.FullName, new[] { searchPattern }, false, false).ToArray(),
|
||||
x => new BdInfoFileInfo(x));
|
||||
}
|
||||
|
||||
public IFileInfo[] GetFiles(string searchPattern, System.IO.SearchOption searchOption)
|
||||
{
|
||||
return Array.ConvertAll(_fileSystem.GetFiles(_impl.FullName, new[] { searchPattern }, false,
|
||||
return Array.ConvertAll(
|
||||
_fileSystem.GetFiles(
|
||||
_impl.FullName,
|
||||
new[] { searchPattern },
|
||||
false,
|
||||
searchOption.HasFlag(System.IO.SearchOption.AllDirectories)).ToArray(),
|
||||
x => new BdInfoFileInfo(x));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.BdInfo
|
||||
{
|
||||
class BdInfoFileInfo : BDInfo.IO.IFileInfo
|
||||
public class BdInfoFileInfo : BDInfo.IO.IFileInfo
|
||||
{
|
||||
FileSystemMetadata _impl = null;
|
||||
private FileSystemMetadata _impl = null;
|
||||
|
||||
public BdInfoFileInfo(FileSystemMetadata impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
|
||||
public string Name => _impl.Name;
|
||||
|
||||
@@ -17,14 +24,10 @@ namespace MediaBrowser.MediaEncoding.BdInfo
|
||||
|
||||
public bool IsDir => _impl.IsDirectory;
|
||||
|
||||
public BdInfoFileInfo(FileSystemMetadata impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
|
||||
public System.IO.Stream OpenRead()
|
||||
{
|
||||
return new FileStream(FullName,
|
||||
return new FileStream(
|
||||
FullName,
|
||||
FileMode.Open,
|
||||
FileAccess.Read,
|
||||
FileShare.Read);
|
||||
|
||||
Reference in New Issue
Block a user