diff --git a/MediaBrowser.Common/app.config b/MediaBrowser.Common/app.config deleted file mode 100644 index 037800f7f..000000000 --- a/MediaBrowser.Common/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/MediaBrowser.Server.Mac.sln b/MediaBrowser.Server.Mac.sln index 91d76ca6d..1813c2029 100644 --- a/MediaBrowser.Server.Mac.sln +++ b/MediaBrowser.Server.Mac.sln @@ -25,8 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Providers", "M EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Implementations", "MediaBrowser.Server.Implementations\MediaBrowser.Server.Implementations.csproj", "{2E781478-814D-4A48-9D80-BFF206441A65}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Mono", "MediaBrowser.Server.Mono\MediaBrowser.Server.Mono.csproj", "{175A9388-F352-4586-A6B4-070DED62B644}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Startup.Common", "MediaBrowser.Server.Startup.Common\MediaBrowser.Server.Startup.Common.csproj", "{B90AB8F2-1BFF-4568-A3FD-2A338A435A75}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.WebDashboard", "MediaBrowser.WebDashboard\MediaBrowser.WebDashboard.csproj", "{5624B7B5-B5A7-41D8-9F10-CC5611109619}" @@ -60,20 +58,6 @@ Global {0BD82FA6-EB8A-4452-8AF5-74F9C3849451}.Release|Any CPU.Build.0 = Release|Any CPU {0BD82FA6-EB8A-4452-8AF5-74F9C3849451}.Release|x86.ActiveCfg = Release|Any CPU {0BD82FA6-EB8A-4452-8AF5-74F9C3849451}.Release|x86.Build.0 = Release|Any CPU - {175A9388-F352-4586-A6B4-070DED62B644}.AppStore|Any CPU.ActiveCfg = Release|Any CPU - {175A9388-F352-4586-A6B4-070DED62B644}.AppStore|Any CPU.Build.0 = Release|Any CPU - {175A9388-F352-4586-A6B4-070DED62B644}.Debug|Any CPU.ActiveCfg = Debug|x86 - {175A9388-F352-4586-A6B4-070DED62B644}.Debug|Any CPU.Build.0 = Debug|x86 - {175A9388-F352-4586-A6B4-070DED62B644}.Debug|x86.ActiveCfg = Debug|x86 - {175A9388-F352-4586-A6B4-070DED62B644}.Debug|x86.Build.0 = Debug|x86 - {175A9388-F352-4586-A6B4-070DED62B644}.Release Mono|Any CPU.ActiveCfg = Release Mono|Any CPU - {175A9388-F352-4586-A6B4-070DED62B644}.Release Mono|Any CPU.Build.0 = Release Mono|Any CPU - {175A9388-F352-4586-A6B4-070DED62B644}.Release Mono|x86.ActiveCfg = Release Mono|x86 - {175A9388-F352-4586-A6B4-070DED62B644}.Release Mono|x86.Build.0 = Release Mono|x86 - {175A9388-F352-4586-A6B4-070DED62B644}.Release|Any CPU.ActiveCfg = Release|Any CPU - {175A9388-F352-4586-A6B4-070DED62B644}.Release|Any CPU.Build.0 = Release|Any CPU - {175A9388-F352-4586-A6B4-070DED62B644}.Release|x86.ActiveCfg = Release|x86 - {175A9388-F352-4586-A6B4-070DED62B644}.Release|x86.Build.0 = Release|x86 {17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}.AppStore|Any CPU.ActiveCfg = Release|Any CPU {17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}.AppStore|Any CPU.Build.0 = Release|Any CPU {17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU diff --git a/MediaBrowser.Server.Mac.userprefs b/MediaBrowser.Server.Mac.userprefs index 4e0fb8a83..233d19c5b 100644 --- a/MediaBrowser.Server.Mac.userprefs +++ b/MediaBrowser.Server.Mac.userprefs @@ -1,32 +1,15 @@  - + - - - - - - - - - - + - - - - - - - - - - - - + + + + diff --git a/MediaBrowser.Server.Mac/Imazen.WebP.dll.config b/MediaBrowser.Server.Mac/Imazen.WebP.dll.config new file mode 100644 index 000000000..1b6270fd5 --- /dev/null +++ b/MediaBrowser.Server.Mac/Imazen.WebP.dll.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/MediaBrowser.Server.Mac/MediaBrowser.MediaInfo.dll.config b/MediaBrowser.Server.Mac/MediaBrowser.MediaInfo.dll.config new file mode 100644 index 000000000..e600a2f2d --- /dev/null +++ b/MediaBrowser.Server.Mac/MediaBrowser.MediaInfo.dll.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj b/MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj index 648bdca05..c64cf598d 100644 --- a/MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj +++ b/MediaBrowser.Server.Mac/MediaBrowser.Server.Mac.csproj @@ -69,10 +69,14 @@ + + ..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll + + @@ -85,19 +89,24 @@ + + + + PreserveNewest + + + PreserveNewest + + - - {175A9388-F352-4586-A6B4-070DED62B644} - MediaBrowser.Server.Mono - {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B} MediaBrowser.Model @@ -126,4 +135,85 @@ + + + False + Dynamic + + + False + Dynamic + + + False + Dynamic + + + False + Dynamic + + + False + Dynamic + + + + + Resources\swagger-ui\index.html + + + Resources\swagger-ui\swagger-ui.js + + + Resources\swagger-ui\swagger-ui.min.js + + + Resources\swagger-ui\css\screen.css + + + Resources\swagger-ui\images\logo_small.png + + + Resources\swagger-ui\images\pet_store_api.png + + + Resources\swagger-ui\images\throbber.gif + + + Resources\swagger-ui\images\wordnik_api.png + + + Resources\swagger-ui\lib\backbone-min.js + + + Resources\swagger-ui\lib\handlebars-1.0.0.js + + + Resources\swagger-ui\lib\highlight.7.3.pack.js + + + Resources\swagger-ui\lib\jquery-1.8.0.min.js + + + Resources\swagger-ui\lib\jquery.ba-bbq.min.js + + + Resources\swagger-ui\lib\jquery.slideto.min.js + + + Resources\swagger-ui\lib\jquery.wiggle.min.js + + + Resources\swagger-ui\lib\shred.bundle.js + + + Resources\swagger-ui\lib\swagger.js + + + Resources\swagger-ui\lib\underscore-min.js + + + Resources\swagger-ui\lib\shred\content.js + + \ No newline at end of file diff --git a/MediaBrowser.Server.Mac/Native/BaseMonoApp.cs b/MediaBrowser.Server.Mac/Native/BaseMonoApp.cs new file mode 100644 index 000000000..a2c860413 --- /dev/null +++ b/MediaBrowser.Server.Mac/Native/BaseMonoApp.cs @@ -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 + { + /// + /// Shutdowns this instance. + /// + public abstract void Shutdown(); + + /// + /// Restarts this instance. + /// + public void Restart() + { + + } + + /// + /// Determines whether this instance [can self restart]. + /// + /// true if this instance [can self restart]; otherwise, false. + public bool CanSelfRestart + { + get + { + return false; + } + } + + /// + /// Gets a value indicating whether this instance can self update. + /// + /// true if this instance can self update; otherwise, false. + public bool CanSelfUpdate + { + get + { + return false; + } + } + + public bool SupportsAutoRunAtStartup + { + get { return false; } + } + + public void PreventSystemStandby() + { + + } + + public List GetAssembliesWithParts() + { + var list = new List(); + + 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; + } + } +} diff --git a/MediaBrowser.Server.Mac/Native/NativeApp.cs b/MediaBrowser.Server.Mac/Native/NativeApp.cs index aedce3d66..f7c2dd4c9 100644 --- a/MediaBrowser.Server.Mac/Native/NativeApp.cs +++ b/MediaBrowser.Server.Mac/Native/NativeApp.cs @@ -1,5 +1,4 @@ using System; -using MediaBrowser.Server.Mono.Native; namespace MediaBrowser.Server.Mac { diff --git a/MediaBrowser.Server.Mac/Native/NetworkManager.cs b/MediaBrowser.Server.Mac/Native/NetworkManager.cs new file mode 100644 index 000000000..6e4e055a2 --- /dev/null +++ b/MediaBrowser.Server.Mac/Native/NetworkManager.cs @@ -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 +{ + /// + /// Class NetUtils + /// + public class NetworkManager : BaseNetworkManager, INetworkManager + { + public NetworkManager(ILogger logger) + : base(logger) + { + } + + /// + /// Gets the network shares. + /// + /// The path. + /// IEnumerable{NetworkShare}. + public IEnumerable GetNetworkShares(string path) + { + return new List (); + } + + /// + /// Gets available devices within the domain + /// + /// PC's in the Domain + public IEnumerable GetNetworkDevices() + { + return new List (); + } + } +} diff --git a/MediaBrowser.Server.Mac/packages.config b/MediaBrowser.Server.Mac/packages.config new file mode 100644 index 000000000..a87b88341 --- /dev/null +++ b/MediaBrowser.Server.Mac/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file