mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
remove mono compiler directives
This commit is contained in:
@@ -222,6 +222,8 @@ namespace MediaBrowser.ServerApplication
|
||||
private readonly StartupOptions _startupOptions;
|
||||
private readonly string _remotePackageName;
|
||||
|
||||
private readonly bool _supportsNativeWebSocket;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApplicationHost" /> class.
|
||||
/// </summary>
|
||||
@@ -230,16 +232,21 @@ namespace MediaBrowser.ServerApplication
|
||||
/// <param name="supportsRunningAsService">if set to <c>true</c> [supports running as service].</param>
|
||||
/// <param name="isRunningAsService">if set to <c>true</c> [is running as service].</param>
|
||||
/// <param name="options">The options.</param>
|
||||
/// <param name="fileSystem">The file system.</param>
|
||||
/// <param name="remotePackageName">Name of the remote package.</param>
|
||||
public ApplicationHost(ServerApplicationPaths applicationPaths,
|
||||
ILogManager logManager,
|
||||
bool supportsRunningAsService,
|
||||
bool isRunningAsService,
|
||||
StartupOptions options, string remotePackageName)
|
||||
: base(applicationPaths, logManager)
|
||||
StartupOptions options,
|
||||
IFileSystem fileSystem,
|
||||
string remotePackageName,
|
||||
bool supportsNativeWebSocket)
|
||||
: base(applicationPaths, logManager, fileSystem)
|
||||
{
|
||||
_startupOptions = options;
|
||||
_remotePackageName = remotePackageName;
|
||||
_supportsNativeWebSocket = supportsNativeWebSocket;
|
||||
_isRunningAsService = isRunningAsService;
|
||||
SupportsRunningAsService = supportsRunningAsService;
|
||||
}
|
||||
@@ -433,7 +440,7 @@ namespace MediaBrowser.ServerApplication
|
||||
|
||||
RegisterSingleInstance<ISearchEngine>(() => new SearchEngine(LogManager, LibraryManager, UserManager));
|
||||
|
||||
HttpServer = ServerFactory.CreateServer(this, LogManager, "Media Browser", WebApplicationName, "dashboard/index.html");
|
||||
HttpServer = ServerFactory.CreateServer(this, LogManager, "Media Browser", WebApplicationName, "dashboard/index.html", _supportsNativeWebSocket);
|
||||
RegisterSingleInstance(HttpServer, false);
|
||||
progress.Report(10);
|
||||
|
||||
@@ -548,11 +555,6 @@ namespace MediaBrowser.ServerApplication
|
||||
return new NetworkManager(logger);
|
||||
}
|
||||
|
||||
protected override IFileSystem CreateFileSystemManager()
|
||||
{
|
||||
return FileSystemFactory.CreateFileSystemManager(LogManager);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers the media encoder.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
#if __MonoCS__
|
||||
using Mono.Unix.Native;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
#endif
|
||||
using Mono.Unix.Native;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@@ -33,7 +29,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
switch (arg)
|
||||
{
|
||||
case "Version":
|
||||
return "20140827";
|
||||
return "20141005";
|
||||
case "FFMpegFilename":
|
||||
return "ffmpeg.exe";
|
||||
case "FFProbeFilename":
|
||||
@@ -82,7 +78,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
switch (arg)
|
||||
{
|
||||
case "Version":
|
||||
return "20140506";
|
||||
return "20140716";
|
||||
case "FFMpegFilename":
|
||||
return "ffmpeg";
|
||||
case "FFProbeFilename":
|
||||
@@ -98,7 +94,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
switch (arg)
|
||||
{
|
||||
case "Version":
|
||||
return "20140505";
|
||||
return "20140716";
|
||||
case "FFMpegFilename":
|
||||
return "ffmpeg";
|
||||
case "FFProbeFilename":
|
||||
@@ -138,15 +134,15 @@ namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
"http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20140827-git-9e8ab36-win64-static.7z",
|
||||
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20140827-git-9e8ab36-win64-static.7z"
|
||||
"http://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20141005-git-e079d43-win64-static.7z",
|
||||
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20141005-git-e079d43-win64-static.7z"
|
||||
};
|
||||
}
|
||||
|
||||
return new[]
|
||||
{
|
||||
"http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20140827-git-9e8ab36-win32-static.7z",
|
||||
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20140827-git-9e8ab36-win32-static.7z"
|
||||
"http://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-20141005-git-e079d43-win32-static.7z",
|
||||
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/windows/ffmpeg-20141005-git-e079d43-win32-static.7z"
|
||||
};
|
||||
|
||||
case PlatformID.Unix:
|
||||
@@ -173,7 +169,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
return new[]
|
||||
{
|
||||
"http://ffmpeg.gusari.org/static/32bit/ffmpeg.static.32bit.latest.tar.gz",
|
||||
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.32bit.2014-05-06.tar.gz"
|
||||
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.32bit.2014-07-16.tar.gz"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -182,7 +178,7 @@ namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
return new[]
|
||||
{
|
||||
"http://ffmpeg.gusari.org/static/64bit/ffmpeg.static.64bit.latest.tar.gz",
|
||||
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.64bit.2014-05-05.tar.gz"
|
||||
"https://github.com/MediaBrowser/MediaBrowser.Resources/raw/master/ffmpeg/linux/ffmpeg.static.64bit.2014-07-16.tar.gz"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -237,16 +233,13 @@ namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
private static Uname GetUnixName()
|
||||
{
|
||||
var uname = new Uname();
|
||||
|
||||
#if __MonoCS__
|
||||
Utsname utsname;
|
||||
var callResult = Syscall.uname(out utsname);
|
||||
if (callResult == 0)
|
||||
{
|
||||
uname.sysname= utsname.sysname;
|
||||
uname.machine= utsname.machine;
|
||||
}
|
||||
#endif
|
||||
Utsname utsname;
|
||||
var callResult = Syscall.uname(out utsname);
|
||||
if (callResult == 0)
|
||||
{
|
||||
uname.sysname = utsname.sysname;
|
||||
uname.machine = utsname.machine;
|
||||
}
|
||||
return uname;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.ServerApplication.IO;
|
||||
using Mono.Unix.Native;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#if __MonoCS__
|
||||
using Mono.Unix.Native;
|
||||
#endif
|
||||
using MediaBrowser.ServerApplication.IO;
|
||||
|
||||
namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
{
|
||||
@@ -228,13 +226,8 @@ namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
}))
|
||||
{
|
||||
File.Copy(file, Path.Combine(targetFolder, Path.GetFileName(file)), true);
|
||||
#if __MonoCS__
|
||||
//Linux: File permission to 666, and user's execute bit
|
||||
if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
|
||||
{
|
||||
Syscall.chmod(Path.Combine(targetFolder, Path.GetFileName(file)), FilePermissions.DEFFILEMODE | FilePermissions.S_IXUSR);
|
||||
}
|
||||
#endif
|
||||
|
||||
SetFilePermissions(targetFolder, file);
|
||||
}
|
||||
}
|
||||
finally
|
||||
@@ -243,6 +236,15 @@ namespace MediaBrowser.ServerApplication.FFMpeg
|
||||
}
|
||||
}
|
||||
|
||||
private void SetFilePermissions(string targetFolder, string file)
|
||||
{
|
||||
// Linux: File permission to 666, and user's execute bit
|
||||
if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
|
||||
{
|
||||
Syscall.chmod(Path.Combine(targetFolder, Path.GetFileName(file)), FilePermissions.DEFFILEMODE | FilePermissions.S_IXUSR);
|
||||
}
|
||||
}
|
||||
|
||||
private void ExtractArchive(string archivePath, string targetPath)
|
||||
{
|
||||
_logger.Info("Extracting {0} to {1}", archivePath, targetPath);
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
|
||||
namespace MediaBrowser.ServerApplication.IO
|
||||
{
|
||||
/// <summary>
|
||||
/// Class FileSystemFactory
|
||||
/// </summary>
|
||||
public static class FileSystemFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates the file system manager.
|
||||
/// </summary>
|
||||
/// <returns>IFileSystem.</returns>
|
||||
public static IFileSystem CreateFileSystemManager(ILogManager logManager)
|
||||
{
|
||||
return new NativeFileSystem(logManager.GetLogger("FileSystem"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ namespace MediaBrowser.ServerApplication.IO
|
||||
{
|
||||
public class NativeFileSystem : CommonFileSystem
|
||||
{
|
||||
public NativeFileSystem(ILogger logger)
|
||||
: base(logger, true)
|
||||
public NativeFileSystem(ILogger logger, bool usePresetInvalidFileNameChars)
|
||||
: base(logger, true, usePresetInvalidFileNameChars)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,16 @@ namespace MediaBrowser.ServerApplication
|
||||
/// <param name="options">The options.</param>
|
||||
private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, bool runService, StartupOptions options)
|
||||
{
|
||||
_appHost = new ApplicationHost(appPaths, logManager, true, runService, options, "MBServer");
|
||||
var fileSystem = new NativeFileSystem(logManager.GetLogger("FileSystem"), false);
|
||||
|
||||
_appHost = new ApplicationHost(appPaths,
|
||||
logManager,
|
||||
true,
|
||||
runService,
|
||||
options,
|
||||
fileSystem,
|
||||
"MBServer",
|
||||
true);
|
||||
|
||||
var initProgress = new Progress<double>();
|
||||
|
||||
|
||||
@@ -63,6 +63,10 @@
|
||||
<Reference Include="MediaBrowser.IsoMounter">
|
||||
<HintPath>..\packages\MediaBrowser.IsoMounting.3.0.69\lib\net45\MediaBrowser.IsoMounter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=3.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\NLog.3.1.0.0\lib\net45\NLog.dll</HintPath>
|
||||
@@ -103,7 +107,6 @@
|
||||
<Compile Include="FFMpeg\FFMpegDownloader.cs" />
|
||||
<Compile Include="FFMpeg\FFMpegDownloadInfo.cs" />
|
||||
<Compile Include="FFMpeg\FFMpegInfo.cs" />
|
||||
<Compile Include="IO\FileSystemFactory.cs" />
|
||||
<Compile Include="IO\NativeFileSystem.cs" />
|
||||
<Compile Include="IO\StartupOptions.cs" />
|
||||
<Compile Include="Logging\LogForm.cs">
|
||||
|
||||
@@ -116,9 +116,9 @@ namespace MediaBrowser.ServerApplication.Native
|
||||
Console.WriteLine("Error launching browser");
|
||||
Console.WriteLine(ex.Message);
|
||||
|
||||
#if !__MonoCS__
|
||||
System.Windows.Forms.MessageBox.Show("There was an error launching your web browser. Please check your default browser settings.");
|
||||
#endif
|
||||
//#if !__MonoCS__
|
||||
// System.Windows.Forms.MessageBox.Show("There was an error launching your web browser. Please check your default browser settings.");
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MediaBrowser.IsoMounting" version="3.0.69" targetFramework="net45" />
|
||||
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
|
||||
<package id="NLog" version="3.1.0.0" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user