moved a few things for mono

This commit is contained in:
Luke Pulverenti
2013-09-24 20:54:51 -04:00
parent 0ab379e271
commit fe5a9232c8
36 changed files with 740 additions and 279 deletions

View File

@@ -0,0 +1,36 @@
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 System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.ServerApplication.FFMpeg
{
public class FFMpegDownloader
{
private readonly IHttpClient _httpClient;
private readonly IApplicationPaths _appPaths;
private readonly ILogger _logger;
private readonly IZipClient _zipClient;
public FFMpegDownloader(ILogger logger, IApplicationPaths appPaths, IHttpClient httpClient, IZipClient zipClient)
{
_logger = logger;
_appPaths = appPaths;
_httpClient = httpClient;
_zipClient = zipClient;
}
public Task<FFMpegInfo> GetFFMpegInfo()
{
return Task.FromResult (new FFMpegInfo());
}
}
}

View File

@@ -40,6 +40,9 @@
<Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
@@ -52,6 +55,25 @@
<Compile Include="gtk-gui\MainWindow.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="..\MediaBrowser.ServerApplication\EntryPoints\StartupWizard.cs">
<Link>EntryPoints\StartupWizard.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.ServerApplication\Native\BrowserLauncher.cs">
<Link>Native\BrowserLauncher.cs</Link>
</Compile>
<Compile Include="Native\Autorun.cs" />
<Compile Include="Native\ServerAuthorization.cs" />
<Compile Include="FFMpeg\FFMpegDownloader.cs" />
<Compile Include="..\MediaBrowser.ServerApplication\FFMpeg\FFMpegInfo.cs">
<Link>FFMpeg\FFMpegInfo.cs</Link>
</Compile>
<Compile Include="..\MediaBrowser.ServerApplication\ApplicationHost.cs">
<Link>ApplicationHost.cs</Link>
</Compile>
<Compile Include="Native\HttpMessageHandlerFactory.cs" />
<Compile Include="Native\Assemblies.cs" />
<Compile Include="Native\Sqlite.cs" />
<Compile Include="Native\NativeApp.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
@@ -88,4 +110,10 @@
<Name>MediaBrowser.Api</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="EntryPoints\" />
<Folder Include="Implementations\" />
<Folder Include="Native\" />
<Folder Include="FFMpeg\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,22 @@
using System.Collections.Generic;
using System.Reflection;
namespace MediaBrowser.ServerApplication.Native
{
/// <summary>
/// Class Assemblies
/// </summary>
public static class Assemblies
{
/// <summary>
/// Gets the assemblies with parts.
/// </summary>
/// <returns>List{Assembly}.</returns>
public static List<Assembly> GetAssembliesWithParts()
{
var list = new List<Assembly>();
return list;
}
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.IO;
namespace MediaBrowser.ServerApplication.Native
{
/// <summary>
/// Class Autorun
/// </summary>
public static class Autorun
{
/// <summary>
/// Configures the specified autorun.
/// </summary>
/// <param name="autorun">if set to <c>true</c> [autorun].</param>
public static void Configure(bool autorun)
{
}
}
}

View File

@@ -0,0 +1,25 @@
using System.Net;
using System.Net.Cache;
using System.Net.Http;
namespace MediaBrowser.ServerApplication.Native
{
/// <summary>
/// Class HttpMessageHandlerFactory
/// </summary>
public static class HttpMessageHandlerFactory
{
/// <summary>
/// Gets the HTTP message handler.
/// </summary>
/// <param name="enableHttpCompression">if set to <c>true</c> [enable HTTP compression].</param>
/// <returns>HttpMessageHandler.</returns>
public static HttpMessageHandler GetHttpMessageHandler(bool enableHttpCompression)
{
return new HttpClientHandler
{
AutomaticDecompression = enableHttpCompression ? DecompressionMethods.Deflate : DecompressionMethods.None
};
}
}
}

View File

@@ -0,0 +1,25 @@

namespace MediaBrowser.ServerApplication.Native
{
/// <summary>
/// Class NativeApp
/// </summary>
public static class NativeApp
{
/// <summary>
/// Shutdowns this instance.
/// </summary>
public static void Shutdown()
{
}
/// <summary>
/// Restarts this instance.
/// </summary>
public static void Restart()
{
}
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace MediaBrowser.ServerApplication.Native
{
/// <summary>
/// Class Authorization
/// </summary>
public static class ServerAuthorization
{
/// <summary>
/// Authorizes the server.
/// </summary>
/// <param name="httpServerPort">The HTTP server port.</param>
/// <param name="httpServerUrlPrefix">The HTTP server URL prefix.</param>
/// <param name="webSocketPort">The web socket port.</param>
/// <param name="udpPort">The UDP port.</param>
/// <param name="tempDirectory">The temp directory.</param>
public static void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int webSocketPort, int udpPort, string tempDirectory)
{
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Data;
using System.Data.SQLite;
using System.Threading.Tasks;
namespace MediaBrowser.ServerApplication.Native
{
/// <summary>
/// Class Sqlite
/// </summary>
public static class Sqlite
{
/// <summary>
/// Connects to db.
/// </summary>
/// <param name="dbPath">The db path.</param>
/// <returns>Task{IDbConnection}.</returns>
/// <exception cref="System.ArgumentNullException">dbPath</exception>
public static async Task<IDbConnection> OpenDatabase(string dbPath)
{
var connectionstr = new SQLiteConnectionStringBuilder
{
PageSize = 4096,
CacheSize = 4096,
SyncMode = SynchronizationModes.Normal,
DataSource = dbPath,
JournalMode = SQLiteJournalModeEnum.Wal
};
var connection = new SQLiteConnection(connectionstr.ConnectionString);
await connection.OpenAsync().ConfigureAwait(false);
return connection;
}
}
}

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<stetic-interface>
<configuration>
<images-root-path>..</images-root-path>
<target-gtk-version>2.12</target-gtk-version>
</configuration>
<import>