aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorabeloin <alexandre.beloin@gmail.com>2013-12-25 14:26:49 -0500
committerabeloin <alexandre.beloin@gmail.com>2013-12-25 14:26:49 -0500
commit68cf16416ba4fb88293b2bdac9867c5534fd7357 (patch)
treeb3cccf82125c474c759e97f3fa215efb8d15893c /MediaBrowser.Server.Implementations
parentbb5e6fdcad9e92b58b754075b8df2387590aeaaf (diff)
Linux fixes:
-Copy PropertyChanged.Fody.dll to Tools/Fody in MediaBrowser.Model.csproj -Check if root for WebSocketServer.FlashAccessPolicyEnabled (port < 1024) -Check resolution value !=0 before SetResolution -Catch _userManager.RefreshUsersMetadata exception when running MB3 for the first time -Fix _appHost.Init() missing argument -FFmpeg: set default and execute permission(766) to ffmpeg and ffprobe -FFmpeg: Detect the OS type and download the correct version -Rename MediaBrowser.WebDashboard/dashboard-ui/scripts/Itemdetailpage.js to itemdetailpage.js
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs9
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs11
-rw-r--r--MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj1
-rw-r--r--MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs17
4 files changed, 38 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
index fbe78e938..7ce0cad73 100644
--- a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
+++ b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
@@ -228,8 +228,17 @@ namespace MediaBrowser.Server.Implementations.Drawing
// Graphics.FromImage will throw an exception if the PixelFormat is Indexed, so we need to handle that here
using (var thumbnail = new Bitmap(newWidth, newHeight, PixelFormat.Format32bppPArgb))
{
+ #if __MonoCS__
+ // Mono throw an exeception if assign 0 to SetResolution
+ if (originalImage.HorizontalResolution != 0 && originalImage.VerticalResolution != 0)
+ {
+ // Preserve the original resolution
+ thumbnail.SetResolution(originalImage.HorizontalResolution, originalImage.VerticalResolution);
+ }
+ #else
// Preserve the original resolution
thumbnail.SetResolution(originalImage.HorizontalResolution, originalImage.VerticalResolution);
+ #endif
using (var thumbnailGraph = Graphics.FromImage(thumbnail))
{
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs b/MediaBrowser.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs
index a0b7ff515..0f35a766a 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs
@@ -28,7 +28,18 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
/// </summary>
public async void Run()
{
+ #if __MonoCS__
+ try
+ {
+ await _userManager.RefreshUsersMetadata(CancellationToken.None).ConfigureAwait(false);
+ }
+ catch
+ {
+ System.Console.WriteLine("RefreshUsersMetadata task error: No users? First time running?");
+ }
+ #else
await _userManager.RefreshUsersMetadata(CancellationToken.None).ConfigureAwait(false);
+ #endif
}
/// <summary>
diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
index 09a39c3eb..efc1549bc 100644
--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
@@ -85,6 +85,7 @@
<Reference Include="ServiceStack.Text">
<HintPath>..\ThirdParty\ServiceStack.Text\ServiceStack.Text.dll</HintPath>
</Reference>
+ <Reference Include="Mono.Posix" Condition=" '$(ConfigurationName)' == 'Release Mono' " />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs">
diff --git a/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs b/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs
index 8be35071a..e46dab23e 100644
--- a/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs
+++ b/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs
@@ -4,6 +4,9 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Model.Logging;
using System;
using System.Net;
+#if __MonoCS__
+using Mono.Unix.Native;
+#endif
namespace MediaBrowser.Server.Implementations.WebSocket
{
@@ -66,6 +69,20 @@ namespace MediaBrowser.Server.Implementations.WebSocket
TimeOut = TimeSpan.FromHours(24)
};
+ #if __MonoCS__
+ //Linux: port below 1024 require root or cap_net_bind_service
+ if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
+ {
+ if (Syscall.getuid() == 0)
+ {
+ WebSocketServer.FlashAccessPolicyEnabled = true;
+ }
+ else
+ {
+ WebSocketServer.FlashAccessPolicyEnabled = false;
+ }
+ }
+ #endif
WebSocketServer.Start();
}
catch (Exception ex)