mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-24 19:14:56 +01:00
moved a few things for mono
This commit is contained in:
22
MediaBrowser.Server.Mono/Native/Assemblies.cs
Normal file
22
MediaBrowser.Server.Mono/Native/Assemblies.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
20
MediaBrowser.Server.Mono/Native/Autorun.cs
Normal file
20
MediaBrowser.Server.Mono/Native/Autorun.cs
Normal 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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
25
MediaBrowser.Server.Mono/Native/HttpMessageHandlerFactory.cs
Normal file
25
MediaBrowser.Server.Mono/Native/HttpMessageHandlerFactory.cs
Normal 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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
25
MediaBrowser.Server.Mono/Native/NativeApp.cs
Normal file
25
MediaBrowser.Server.Mono/Native/NativeApp.cs
Normal 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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
26
MediaBrowser.Server.Mono/Native/ServerAuthorization.cs
Normal file
26
MediaBrowser.Server.Mono/Native/ServerAuthorization.cs
Normal 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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
36
MediaBrowser.Server.Mono/Native/Sqlite.cs
Normal file
36
MediaBrowser.Server.Mono/Native/Sqlite.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user