mono fixes
This commit is contained in:
parent
b40991b28d
commit
54a5d63a61
|
@ -66,16 +66,14 @@ namespace MediaBrowser.Api.DefaultTheme
|
|||
private readonly ILogger _logger;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
private readonly ILocalizationManager _localization;
|
||||
private readonly IImageProcessor _imageProcessor;
|
||||
|
||||
public DefaultThemeService(IUserManager userManager, IDtoService dtoService, ILogger logger, ILibraryManager libraryManager, ILocalizationManager localization, IImageProcessor imageProcessor)
|
||||
public DefaultThemeService(IUserManager userManager, IDtoService dtoService, ILogger logger, ILibraryManager libraryManager, IImageProcessor imageProcessor)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_dtoService = dtoService;
|
||||
_logger = logger;
|
||||
_libraryManager = libraryManager;
|
||||
_localization = localization;
|
||||
_imageProcessor = imageProcessor;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,11 +48,6 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
/// </summary>
|
||||
public class YearsService : BaseItemsByNameService<Year>
|
||||
{
|
||||
/// <summary>
|
||||
/// The us culture
|
||||
/// </summary>
|
||||
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||
|
||||
public YearsService(IUserManager userManager, ILibraryManager libraryManager, IUserDataManager userDataRepository, IItemRepository itemRepo, IDtoService dtoService)
|
||||
: base(userManager, libraryManager, userDataRepository, itemRepo, dtoService)
|
||||
{
|
||||
|
|
|
@ -555,11 +555,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||
{
|
||||
throw new ArgumentNullException("url");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -361,11 +361,6 @@ namespace MediaBrowser.Common.Implementations.Updates
|
|||
throw new ArgumentNullException("progress");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
var installationInfo = new InstallationInfo
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
|
|
|
@ -1066,7 +1066,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <returns>IList{BaseItem}.</returns>
|
||||
public IList<BaseItem> GetRecursiveChildren()
|
||||
{
|
||||
return GetRecursiveChildren(null, null, true);
|
||||
return GetRecursiveChildren(i => true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -130,17 +130,17 @@ namespace MediaBrowser.Controller.Localization
|
|||
{
|
||||
value = field.GetValue(stringData) as string;
|
||||
}
|
||||
catch (TargetException ex)
|
||||
catch (TargetException)
|
||||
{
|
||||
//Logger.ErrorException("Error getting value for field: {0}", ex, field.Name);
|
||||
continue;
|
||||
}
|
||||
catch (FieldAccessException ex)
|
||||
catch (FieldAccessException)
|
||||
{
|
||||
//Logger.ErrorException("Error getting value for field: {0}", ex, field.Name);
|
||||
continue;
|
||||
}
|
||||
catch (NotSupportedException ex)
|
||||
catch (NotSupportedException)
|
||||
{
|
||||
//Logger.ErrorException("Error getting value for field: {0}", ex, field.Name);
|
||||
continue;
|
||||
|
|
|
@ -382,22 +382,23 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
/// <returns>Task.</returns>
|
||||
private async Task ProcessWebSocketRequest(HttpListenerContext ctx)
|
||||
{
|
||||
#if __MonoCS__
|
||||
#else
|
||||
try
|
||||
{
|
||||
var webSocketContext = await ctx.AcceptWebSocketAsync(null).ConfigureAwait(false);
|
||||
|
||||
if (WebSocketConnected != null)
|
||||
{
|
||||
WebSocketConnected(this, new WebSocketConnectEventArgs { WebSocket = new NativeWebSocket(webSocketContext.WebSocket, _logger), Endpoint = ctx.Request.RemoteEndPoint.ToString() });
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("AcceptWebSocketAsync error", ex);
|
||||
|
||||
ctx.Response.StatusCode = 500;
|
||||
ctx.Response.Close();
|
||||
}
|
||||
{
|
||||
var webSocketContext = await ctx.AcceptWebSocketAsync(null).ConfigureAwait(false);
|
||||
if (WebSocketConnected != null)
|
||||
{
|
||||
WebSocketConnected(this, new WebSocketConnectEventArgs { WebSocket = new NativeWebSocket(webSocketContext.WebSocket, _logger), Endpoint = ctx.Request.RemoteEndPoint.ToString() });
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("AcceptWebSocketAsync error", ex);
|
||||
ctx.Response.StatusCode = 500;
|
||||
ctx.Response.Close();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -532,7 +533,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
{
|
||||
get
|
||||
{
|
||||
if (!_supportsNativeWebSocket.HasValue)
|
||||
#if __MonoCS__
|
||||
return false;
|
||||
#else
|
||||
#endif
|
||||
|
||||
if (!_supportsNativeWebSocket.HasValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -57,10 +57,6 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
{
|
||||
throw new ArgumentNullException("userData");
|
||||
}
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
if (userId == Guid.Empty)
|
||||
{
|
||||
throw new ArgumentNullException("userId");
|
||||
|
|
|
@ -15,20 +15,14 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
/// </summary>
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
/// <summary>
|
||||
/// The _user manager
|
||||
/// </summary>
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GameGenresPostScanTask"/> class.
|
||||
/// </summary>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
public GameGenresPostScanTask(ILibraryManager libraryManager, IUserManager userManager)
|
||||
public GameGenresPostScanTask(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -12,20 +12,14 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
/// </summary>
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
/// <summary>
|
||||
/// The _user manager
|
||||
/// </summary>
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArtistsPostScanTask" /> class.
|
||||
/// </summary>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
public GenresPostScanTask(ILibraryManager libraryManager, IUserManager userManager)
|
||||
public GenresPostScanTask(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -15,20 +15,14 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
/// </summary>
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
/// <summary>
|
||||
/// The _user manager
|
||||
/// </summary>
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArtistsPostScanTask" /> class.
|
||||
/// </summary>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
public MusicGenresPostScanTask(ILibraryManager libraryManager, IUserManager userManager)
|
||||
public MusicGenresPostScanTask(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -15,20 +15,14 @@ namespace MediaBrowser.Server.Implementations.Library.Validators
|
|||
/// </summary>
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
|
||||
/// <summary>
|
||||
/// The _user manager
|
||||
/// </summary>
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArtistsPostScanTask" /> class.
|
||||
/// </summary>
|
||||
/// <param name="libraryManager">The library manager.</param>
|
||||
/// <param name="userManager">The user manager.</param>
|
||||
public StudiosPostScanTask(ILibraryManager libraryManager, IUserManager userManager)
|
||||
public StudiosPostScanTask(ILibraryManager libraryManager)
|
||||
{
|
||||
_libraryManager = libraryManager;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -594,11 +594,6 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
|
|||
throw new ArgumentNullException("outputPath");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
var slowSeekParam = offset.TotalSeconds > 0 ? " -ss " + offset.TotalSeconds.ToString(UsCulture) : string.Empty;
|
||||
|
||||
var process = new Process
|
||||
|
|
|
@ -188,11 +188,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
throw new ArgumentNullException("chapters");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
await _writeLock.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
|
|
@ -112,10 +112,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
{
|
||||
throw new ArgumentNullException("displayPreferences.Id");
|
||||
}
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
|
|
|
@ -186,11 +186,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
throw new ArgumentNullException("items");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
await _writeLock.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
@ -456,11 +451,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
throw new ArgumentNullException("children");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
await _writeLock.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
|
|
@ -116,10 +116,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
{
|
||||
throw new ArgumentNullException("userData");
|
||||
}
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
if (userId == Guid.Empty)
|
||||
{
|
||||
throw new ArgumentNullException("userId");
|
||||
|
|
|
@ -98,11 +98,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
throw new ArgumentNullException("user");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var serialized = _jsonSerializer.SerializeToBytes(user);
|
||||
|
@ -199,11 +194,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
throw new ArgumentNullException("user");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
await _writeLock.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
|
|
@ -269,10 +269,6 @@ namespace MediaBrowser.Server.Implementations.Providers
|
|||
{
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
|
|
|
@ -285,11 +285,6 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||
throw new ArgumentNullException("dataFunction");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var connectionsList = connections.Where(s => s.State == WebSocketState.Open).ToList();
|
||||
|
|
|
@ -216,11 +216,6 @@ namespace MediaBrowser.Server.Implementations.ServerManager
|
|||
throw new ArgumentNullException("buffer");
|
||||
}
|
||||
|
||||
if (cancellationToken == null)
|
||||
{
|
||||
throw new ArgumentNullException("cancellationToken");
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
// Per msdn docs, attempting to send simultaneous messages will result in one failing.
|
||||
|
|
|
@ -47,8 +47,6 @@ namespace MediaBrowser.Server.Mono
|
|||
|
||||
bool createdNew;
|
||||
|
||||
var runningPath = Process.GetCurrentProcess().MainModule.FileName.Replace(Path.DirectorySeparatorChar.ToString(), string.Empty);
|
||||
|
||||
//_singleInstanceMutex = new Mutex(true, @"Local\" + runningPath, out createdNew);
|
||||
createdNew = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user