mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 06:48:35 +01:00
Apply review suggestions
This commit is contained in:
@@ -1,41 +1,68 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.BdInfo
|
||||
namespace MediaBrowser.MediaEncoding.BdInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Class BdInfoFileInfo.
|
||||
/// </summary>
|
||||
public class BdInfoFileInfo : BDInfo.IO.IFileInfo
|
||||
{
|
||||
public class BdInfoFileInfo : BDInfo.IO.IFileInfo
|
||||
private FileSystemMetadata _impl;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BdInfoFileInfo" /> class.
|
||||
/// </summary>
|
||||
/// <param name="impl">The <see cref="FileSystemMetadata" />.</param>
|
||||
public BdInfoFileInfo(FileSystemMetadata impl)
|
||||
{
|
||||
private FileSystemMetadata _impl;
|
||||
_impl = impl;
|
||||
}
|
||||
|
||||
public BdInfoFileInfo(FileSystemMetadata impl)
|
||||
{
|
||||
_impl = impl;
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
public string Name => _impl.Name;
|
||||
|
||||
public string Name => _impl.Name;
|
||||
/// <summary>
|
||||
/// Gets the full name.
|
||||
/// </summary>
|
||||
public string FullName => _impl.FullName;
|
||||
|
||||
public string FullName => _impl.FullName;
|
||||
/// <summary>
|
||||
/// Gets the extension.
|
||||
/// </summary>
|
||||
public string Extension => _impl.Extension;
|
||||
|
||||
public string Extension => _impl.Extension;
|
||||
/// <summary>
|
||||
/// Gets the length.
|
||||
/// </summary>
|
||||
public long Length => _impl.Length;
|
||||
|
||||
public long Length => _impl.Length;
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this is a directory.
|
||||
/// </summary>
|
||||
public bool IsDir => _impl.IsDirectory;
|
||||
|
||||
public bool IsDir => _impl.IsDirectory;
|
||||
/// <summary>
|
||||
/// Gets a file as file stream.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="FileStream" /> for the file.</returns>
|
||||
public Stream OpenRead()
|
||||
{
|
||||
return new FileStream(
|
||||
FullName,
|
||||
FileMode.Open,
|
||||
FileAccess.Read,
|
||||
FileShare.Read);
|
||||
}
|
||||
|
||||
public Stream OpenRead()
|
||||
{
|
||||
return new FileStream(
|
||||
FullName,
|
||||
FileMode.Open,
|
||||
FileAccess.Read,
|
||||
FileShare.Read);
|
||||
}
|
||||
|
||||
public StreamReader OpenText()
|
||||
{
|
||||
return new StreamReader(OpenRead());
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets a files's content with a stream reader.
|
||||
/// </summary>
|
||||
/// <returns>A <see cref="StreamReader" /> for the file's content.</returns>
|
||||
public StreamReader OpenText()
|
||||
{
|
||||
return new StreamReader(OpenRead());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user