mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
Add analysers to Emby.IsoMounting and enable TreatWarningsAsErrors
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -8,12 +9,12 @@ using MediaBrowser.Model.IO;
|
||||
namespace Emby.Server.Implementations.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Class IsoManager
|
||||
/// Class IsoManager.
|
||||
/// </summary>
|
||||
public class IsoManager : IIsoManager
|
||||
{
|
||||
/// <summary>
|
||||
/// The _mounters
|
||||
/// The _mounters.
|
||||
/// </summary>
|
||||
private readonly List<IIsoMounter> _mounters = new List<IIsoMounter>();
|
||||
|
||||
@@ -22,9 +23,7 @@ namespace Emby.Server.Implementations.IO
|
||||
/// </summary>
|
||||
/// <param name="isoPath">The iso path.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>IsoMount.</returns>
|
||||
/// <exception cref="ArgumentNullException">isoPath</exception>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
/// <returns><see creaf="IsoMount" />.</returns>
|
||||
public Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken)
|
||||
{
|
||||
if (string.IsNullOrEmpty(isoPath))
|
||||
@@ -36,7 +35,11 @@ namespace Emby.Server.Implementations.IO
|
||||
|
||||
if (mounter == null)
|
||||
{
|
||||
throw new ArgumentException(string.Format("No mounters are able to mount {0}", isoPath));
|
||||
throw new ArgumentException(
|
||||
string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"No mounters are able to mount {0}",
|
||||
isoPath));
|
||||
}
|
||||
|
||||
return mounter.Mount(isoPath, cancellationToken);
|
||||
@@ -60,16 +63,5 @@ namespace Emby.Server.Implementations.IO
|
||||
{
|
||||
_mounters.AddRange(mounters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (var mounter in _mounters)
|
||||
{
|
||||
mounter.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user