mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-20 05:04:18 +01:00
update mac project
This commit is contained in:
3
MediaBrowser.Server.Mac/Imazen.WebP.dll.config
Normal file
3
MediaBrowser.Server.Mac/Imazen.WebP.dll.config
Normal file
@@ -0,0 +1,3 @@
|
||||
<configuration>
|
||||
<dllmap dll="libwebp" target="libwebp.5.dylib" os="osx"/>
|
||||
</configuration>
|
||||
@@ -0,0 +1,3 @@
|
||||
<configuration>
|
||||
<dllmap dll="MediaInfo" target="libmediainfo.dylib" os="osx"/>
|
||||
</configuration>
|
||||
@@ -69,10 +69,14 @@
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="XamMac" />
|
||||
<Reference Include="Mono.Posix">
|
||||
<HintPath>..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
<Folder Include="Native\" />
|
||||
<Folder Include="Resources\swagger-ui\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
@@ -85,19 +89,24 @@
|
||||
</Compile>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="Native\NativeApp.cs" />
|
||||
<Compile Include="Native\BaseMonoApp.cs" />
|
||||
<Compile Include="Native\NetworkManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="MainMenu.xib" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
<None Include="MediaBrowser.MediaInfo.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Imazen.WebP.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MediaBrowser.Server.Mono\MediaBrowser.Server.Mono.csproj">
|
||||
<Project>{175A9388-F352-4586-A6B4-070DED62B644}</Project>
|
||||
<Name>MediaBrowser.Server.Mono</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
|
||||
<Project>{7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}</Project>
|
||||
<Name>MediaBrowser.Model</Name>
|
||||
@@ -126,4 +135,85 @@
|
||||
<ItemGroup>
|
||||
<Content Include="touchicon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<NativeReference Include="..\ThirdParty\MediaInfo\osx\libmediainfo.dylib">
|
||||
<IsCxx>False</IsCxx>
|
||||
<Kind>Dynamic</Kind>
|
||||
</NativeReference>
|
||||
<NativeReference Include="..\ThirdParty\libwebp\osx\libwebp.5.dylib">
|
||||
<IsCxx>False</IsCxx>
|
||||
<Kind>Dynamic</Kind>
|
||||
</NativeReference>
|
||||
<NativeReference Include="..\ThirdParty\SQLite3\osx\libsqlite3.0.dylib">
|
||||
<IsCxx>False</IsCxx>
|
||||
<Kind>Dynamic</Kind>
|
||||
</NativeReference>
|
||||
<NativeReference Include="..\ThirdParty\SQLite3\osx\libsqlite3.dylib">
|
||||
<IsCxx>False</IsCxx>
|
||||
<Kind>Dynamic</Kind>
|
||||
</NativeReference>
|
||||
<NativeReference Include="..\ThirdParty\libgdiplus\osx\libgdiplus.dylib">
|
||||
<IsCxx>False</IsCxx>
|
||||
<Kind>Dynamic</Kind>
|
||||
</NativeReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\index.html">
|
||||
<Link>Resources\swagger-ui\index.html</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\swagger-ui.js">
|
||||
<Link>Resources\swagger-ui\swagger-ui.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\swagger-ui.min.js">
|
||||
<Link>Resources\swagger-ui\swagger-ui.min.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\css\screen.css">
|
||||
<Link>Resources\swagger-ui\css\screen.css</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\images\logo_small.png">
|
||||
<Link>Resources\swagger-ui\images\logo_small.png</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\images\pet_store_api.png">
|
||||
<Link>Resources\swagger-ui\images\pet_store_api.png</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\images\throbber.gif">
|
||||
<Link>Resources\swagger-ui\images\throbber.gif</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\images\wordnik_api.png">
|
||||
<Link>Resources\swagger-ui\images\wordnik_api.png</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\backbone-min.js">
|
||||
<Link>Resources\swagger-ui\lib\backbone-min.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\handlebars-1.0.0.js">
|
||||
<Link>Resources\swagger-ui\lib\handlebars-1.0.0.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\highlight.7.3.pack.js">
|
||||
<Link>Resources\swagger-ui\lib\highlight.7.3.pack.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery-1.8.0.min.js">
|
||||
<Link>Resources\swagger-ui\lib\jquery-1.8.0.min.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.ba-bbq.min.js">
|
||||
<Link>Resources\swagger-ui\lib\jquery.ba-bbq.min.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.slideto.min.js">
|
||||
<Link>Resources\swagger-ui\lib\jquery.slideto.min.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.wiggle.min.js">
|
||||
<Link>Resources\swagger-ui\lib\jquery.wiggle.min.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\shred.bundle.js">
|
||||
<Link>Resources\swagger-ui\lib\shred.bundle.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\swagger.js">
|
||||
<Link>Resources\swagger-ui\lib\swagger.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\underscore-min.js">
|
||||
<Link>Resources\swagger-ui\lib\underscore-min.js</Link>
|
||||
</BundleResource>
|
||||
<BundleResource Include="..\ThirdParty\ServiceStack\swagger-ui\lib\shred\content.js">
|
||||
<Link>Resources\swagger-ui\lib\shred\content.js</Link>
|
||||
</BundleResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
165
MediaBrowser.Server.Mac/Native/BaseMonoApp.cs
Normal file
165
MediaBrowser.Server.Mac/Native/BaseMonoApp.cs
Normal file
@@ -0,0 +1,165 @@
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Server.Startup.Common;
|
||||
using Mono.Unix.Native;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace MediaBrowser.Server.Mac
|
||||
{
|
||||
public abstract class BaseMonoApp : INativeApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Shutdowns this instance.
|
||||
/// </summary>
|
||||
public abstract void Shutdown();
|
||||
|
||||
/// <summary>
|
||||
/// Restarts this instance.
|
||||
/// </summary>
|
||||
public void Restart()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this instance [can self restart].
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if this instance [can self restart]; otherwise, <c>false</c>.</returns>
|
||||
public bool CanSelfRestart
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance can self update.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
|
||||
public bool CanSelfUpdate
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SupportsAutoRunAtStartup
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public void PreventSystemStandby()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public List<Assembly> GetAssembliesWithParts()
|
||||
{
|
||||
var list = new List<Assembly>();
|
||||
|
||||
list.Add(GetType().Assembly);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory)
|
||||
{
|
||||
}
|
||||
|
||||
private NativeEnvironment _nativeEnvironment;
|
||||
public NativeEnvironment Environment
|
||||
{
|
||||
get { return _nativeEnvironment ?? (_nativeEnvironment = GetEnvironmentInfo()); }
|
||||
}
|
||||
|
||||
public bool SupportsRunningAsService
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsRunningAsService
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void ConfigureAutoRun(bool autorun)
|
||||
{
|
||||
}
|
||||
|
||||
public INetworkManager CreateNetworkManager(ILogger logger)
|
||||
{
|
||||
return new NetworkManager(logger);
|
||||
}
|
||||
|
||||
private NativeEnvironment GetEnvironmentInfo()
|
||||
{
|
||||
var info = new NativeEnvironment
|
||||
{
|
||||
OperatingSystem = Startup.Common.OperatingSystem.Linux
|
||||
};
|
||||
|
||||
var uname = GetUnixName();
|
||||
|
||||
var sysName = uname.sysname ?? string.Empty;
|
||||
|
||||
info.OperatingSystem = Startup.Common.OperatingSystem.Osx;
|
||||
|
||||
var archX86 = new Regex("(i|I)[3-6]86");
|
||||
|
||||
if (archX86.IsMatch(uname.machine))
|
||||
{
|
||||
info.SystemArchitecture = Architecture.X86;
|
||||
}
|
||||
else if (string.Equals(uname.machine, "x86_64", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
info.SystemArchitecture = Architecture.X86_X64;
|
||||
}
|
||||
else if (uname.machine.StartsWith("arm", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
info.SystemArchitecture = Architecture.Arm;
|
||||
}
|
||||
|
||||
info.OperatingSystemVersionString = string.IsNullOrWhiteSpace(sysName) ?
|
||||
System.Environment.OSVersion.VersionString :
|
||||
sysName;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
private Uname _unixName;
|
||||
private Uname GetUnixName()
|
||||
{
|
||||
if (_unixName == null)
|
||||
{
|
||||
var uname = new Uname();
|
||||
Utsname utsname;
|
||||
var callResult = Syscall.uname(out utsname);
|
||||
if (callResult == 0)
|
||||
{
|
||||
uname.sysname = utsname.sysname;
|
||||
uname.machine = utsname.machine;
|
||||
}
|
||||
|
||||
_unixName = uname;
|
||||
}
|
||||
return _unixName;
|
||||
}
|
||||
|
||||
private class Uname
|
||||
{
|
||||
public string sysname = string.Empty;
|
||||
public string machine = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using MediaBrowser.Server.Mono.Native;
|
||||
|
||||
namespace MediaBrowser.Server.Mac
|
||||
{
|
||||
|
||||
39
MediaBrowser.Server.Mac/Native/NetworkManager.cs
Normal file
39
MediaBrowser.Server.Mac/Native/NetworkManager.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using MediaBrowser.Common.Implementations.Networking;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Server.Mac
|
||||
{
|
||||
/// <summary>
|
||||
/// Class NetUtils
|
||||
/// </summary>
|
||||
public class NetworkManager : BaseNetworkManager, INetworkManager
|
||||
{
|
||||
public NetworkManager(ILogger logger)
|
||||
: base(logger)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the network shares.
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <returns>IEnumerable{NetworkShare}.</returns>
|
||||
public IEnumerable<NetworkShare> GetNetworkShares(string path)
|
||||
{
|
||||
return new List<NetworkShare> ();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets available devices within the domain
|
||||
/// </summary>
|
||||
/// <returns>PC's in the Domain</returns>
|
||||
public IEnumerable<FileSystemEntryInfo> GetNetworkDevices()
|
||||
{
|
||||
return new List<FileSystemEntryInfo> ();
|
||||
}
|
||||
}
|
||||
}
|
||||
4
MediaBrowser.Server.Mac/packages.config
Normal file
4
MediaBrowser.Server.Mac/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user