sync updates

pull/702/head
Luke Pulverenti 10 years ago
parent 0840bb9ba2
commit 7bce2e04b6

@ -85,6 +85,13 @@ namespace MediaBrowser.Api.Sync
{ {
} }
[Route("/Sync/Items/Ready", "GET", Summary = "Gets ready to download sync items.")]
public class GetReadySyncItems : IReturn<List<SyncedItem>>
{
[ApiMember(Name = "TargetId", Description = "TargetId", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "GET")]
public string TargetId { get; set; }
}
[Authenticated] [Authenticated]
public class SyncService : BaseApiService public class SyncService : BaseApiService
{ {
@ -207,5 +214,10 @@ namespace MediaBrowser.Api.Sync
await _syncManager.ReportOfflineAction(action).ConfigureAwait(false); await _syncManager.ReportOfflineAction(action).ConfigureAwait(false);
} }
} }
public object Get(GetReadySyncItems request)
{
return ToOptimizedResult(_syncManager.GetReadySyncItems(request.TargetId));
}
} }
} }

@ -14,6 +14,7 @@ using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Library; using MediaBrowser.Model.Library;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Users;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -21,7 +22,6 @@ using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Controller.Entities namespace MediaBrowser.Controller.Entities
{ {

@ -1,5 +1,4 @@
using MediaBrowser.Common.Net; using MediaBrowser.Model.Net;
using MediaBrowser.Model.Net;
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;

@ -82,18 +82,18 @@ namespace MediaBrowser.Controller.Sync
/// <returns>SyncJobItem.</returns> /// <returns>SyncJobItem.</returns>
SyncJobItem GetJobItem(string id); SyncJobItem GetJobItem(string id);
/// <summary>
/// Gets the job item information.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>SyncedItem.</returns>
SyncedItem GetJobItemInfo(string id);
/// <summary> /// <summary>
/// Reports the offline action. /// Reports the offline action.
/// </summary> /// </summary>
/// <param name="action">The action.</param> /// <param name="action">The action.</param>
/// <returns>Task.</returns> /// <returns>Task.</returns>
Task ReportOfflineAction(UserAction action); Task ReportOfflineAction(UserAction action);
/// <summary>
/// Gets the ready synchronize items.
/// </summary>
/// <param name="targetId">The target identifier.</param>
/// <returns>List&lt;SyncedItem&gt;.</returns>
List<SyncedItem> GetReadySyncItems(string targetId);
} }
} }

@ -7,7 +7,6 @@ using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Localization; using MediaBrowser.Controller.Localization;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session; using MediaBrowser.Controller.Session;

@ -165,6 +165,7 @@ namespace MediaBrowser.Model.Configuration
public string[] InsecureApps7 { get; set; } public string[] InsecureApps7 { get; set; }
public bool SaveMetadataHidden { get; set; } public bool SaveMetadataHidden { get; set; }
public bool EnableWin8HttpListener { get; set; }
public NameValuePair[] ContentTypes { get; set; } public NameValuePair[] ContentTypes { get; set; }
@ -180,6 +181,7 @@ namespace MediaBrowser.Model.Configuration
EnableDashboardResponseCaching = true; EnableDashboardResponseCaching = true;
EnableAutomaticRestart = true; EnableAutomaticRestart = true;
EnableWin8HttpListener = true;
EnableUPnP = true; EnableUPnP = true;

@ -3,7 +3,7 @@ namespace MediaBrowser.Model.Sync
{ {
public class DeviceFileInfo public class DeviceFileInfo
{ {
public string Path { get; set; } public string[] Path { get; set; }
public string Name { get; set; } public string Name { get; set; }
} }
} }

@ -18,7 +18,7 @@ namespace MediaBrowser.Model.Sync
/// Gets or sets the path. /// Gets or sets the path.
/// </summary> /// </summary>
/// <value>The path.</value> /// <value>The path.</value>
public string Path { get; set; } public string[] Path { get; set; }
/// <summary> /// <summary>
/// Gets or sets the type of the image. /// Gets or sets the type of the image.
/// </summary> /// </summary>

@ -1,7 +1,6 @@
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Connect; using MediaBrowser.Controller.Connect;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using System; using System;

@ -1,6 +1,5 @@
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller; using MediaBrowser.Controller;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;

@ -1,8 +1,6 @@
using MediaBrowser.Common; using MediaBrowser.Common;
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Implementations.Security;
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session; using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;

@ -4,7 +4,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Controller.Net;
namespace MediaBrowser.Server.Implementations.EntryPoints namespace MediaBrowser.Server.Implementations.EntryPoints
{ {

@ -1,7 +1,6 @@
using Funq; using Funq;
using MediaBrowser.Common; using MediaBrowser.Common;
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Implementations.HttpServer.NetListener; using MediaBrowser.Server.Implementations.HttpServer.NetListener;
@ -205,10 +204,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
{ {
HostContext.Config.HandlerFactoryPath = ListenerRequest.GetHandlerPathIfAny(UrlPrefixes.First()); HostContext.Config.HandlerFactoryPath = ListenerRequest.GetHandlerPathIfAny(UrlPrefixes.First());
_listener = _supportsNativeWebSocket && NativeWebSocket.IsSupported _listener = GetListener();
//? _listener = new HttpListenerServer(_logger, OnRequestReceived)
? _listener = new WebSocketSharpListener(_logger, OnRequestReceived)
: _listener = new WebSocketSharpListener(_logger, OnRequestReceived);
_listener.WebSocketHandler = WebSocketHandler; _listener.WebSocketHandler = WebSocketHandler;
_listener.ErrorHandler = ErrorHandler; _listener.ErrorHandler = ErrorHandler;
@ -217,6 +213,16 @@ namespace MediaBrowser.Server.Implementations.HttpServer
_listener.Start(UrlPrefixes); _listener.Start(UrlPrefixes);
} }
private IHttpListener GetListener()
{
if (_supportsNativeWebSocket && NativeWebSocket.IsSupported)
{
return new HttpListenerServer(_logger, OnRequestReceived);
}
return new WebSocketSharpListener(_logger, OnRequestReceived);
}
private void WebSocketHandler(WebSocketConnectEventArgs args) private void WebSocketHandler(WebSocketConnectEventArgs args)
{ {
if (WebSocketConnected != null) if (WebSocketConnected != null)

@ -1,9 +1,8 @@
using System.Threading.Tasks; using MediaBrowser.Controller.Net;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net;
using ServiceStack.Web; using ServiceStack.Web;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.HttpServer namespace MediaBrowser.Server.Implementations.HttpServer
{ {

@ -1,10 +1,9 @@
using System.Text; using MediaBrowser.Common.Events;
using MediaBrowser.Common.Events;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using System; using System;
using System.Net.WebSockets; using System.Net.WebSockets;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using WebSocketMessageType = MediaBrowser.Model.Net.WebSocketMessageType; using WebSocketMessageType = MediaBrowser.Model.Net.WebSocketMessageType;

@ -1,5 +1,4 @@
using MediaBrowser.Common.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using ServiceStack; using ServiceStack;
using ServiceStack.Host.HttpListener; using ServiceStack.Host.HttpListener;

@ -1,12 +1,9 @@
using System.Text; using MediaBrowser.Common.Events;
using MediaBrowser.Common.Events;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using WebSocketMessageType = MediaBrowser.Model.Net.WebSocketMessageType;
using WebSocketState = MediaBrowser.Model.Net.WebSocketState; using WebSocketState = MediaBrowser.Model.Net.WebSocketState;
namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp

@ -1,5 +1,4 @@
using MediaBrowser.Common.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using ServiceStack; using ServiceStack;
using ServiceStack.Web; using ServiceStack.Web;

@ -1,5 +1,4 @@
using MediaBrowser.Common.Events; using MediaBrowser.Common.Events;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;

@ -1,5 +1,4 @@
using MediaBrowser.Common.Net; using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Session; using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;

@ -32,12 +32,12 @@ namespace MediaBrowser.Server.Implementations.Sync
private readonly IImageProcessor _imageProcessor; private readonly IImageProcessor _imageProcessor;
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IDtoService _dtoService; private readonly Func<IDtoService> _dtoService;
private readonly IApplicationHost _appHost; private readonly IApplicationHost _appHost;
private ISyncProvider[] _providers = { }; private ISyncProvider[] _providers = { };
public SyncManager(ILibraryManager libraryManager, ISyncRepository repo, IImageProcessor imageProcessor, ILogger logger, IUserManager userManager, IDtoService dtoService, IApplicationHost appHost) public SyncManager(ILibraryManager libraryManager, ISyncRepository repo, IImageProcessor imageProcessor, ILogger logger, IUserManager userManager, Func<IDtoService> dtoService, IApplicationHost appHost)
{ {
_libraryManager = libraryManager; _libraryManager = libraryManager;
_repo = repo; _repo = repo;
@ -323,9 +323,8 @@ namespace MediaBrowser.Server.Implementations.Sync
return _repo.GetJobItems(query); return _repo.GetJobItems(query);
} }
public SyncedItem GetJobItemInfo(string id) private SyncedItem GetJobItemInfo(SyncJobItem jobItem)
{ {
var jobItem = GetJobItem(id);
var job = _repo.GetJob(jobItem.JobId); var job = _repo.GetJob(jobItem.JobId);
var libraryItem = _libraryManager.GetItemById(jobItem.ItemId); var libraryItem = _libraryManager.GetItemById(jobItem.ItemId);
@ -338,7 +337,7 @@ namespace MediaBrowser.Server.Implementations.Sync
UserId = job.UserId UserId = job.UserId
}; };
syncedItem.Item = _dtoService.GetBaseItemDto(libraryItem, new DtoOptions()); syncedItem.Item = _dtoService().GetBaseItemDto(libraryItem, new DtoOptions());
// TODO: this should be the media source of the transcoded output // TODO: this should be the media source of the transcoded output
syncedItem.Item.MediaSources = syncedItem.Item.MediaSources syncedItem.Item.MediaSources = syncedItem.Item.MediaSources
@ -365,5 +364,16 @@ namespace MediaBrowser.Server.Implementations.Sync
{ {
return Task.FromResult(true); return Task.FromResult(true);
} }
public List<SyncedItem> GetReadySyncItems(string targetId)
{
var jobItemResult = GetJobItems(new SyncJobItemQuery
{
TargetId = targetId,
//Status = SyncJobItemStatus.Transferring
});
return jobItemResult.Items.Select(GetJobItemInfo).ToList();
}
} }
} }

@ -36,7 +36,7 @@ namespace MediaBrowser.Server.Implementations.Sync
public async Task Initialize() public async Task Initialize()
{ {
var dbFile = Path.Combine(_appPaths.DataPath, "sync7.db"); var dbFile = Path.Combine(_appPaths.DataPath, "sync8.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false); _connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
@ -298,7 +298,8 @@ namespace MediaBrowser.Server.Implementations.Sync
_deleteJobCommand.Transaction = transaction; _deleteJobCommand.Transaction = transaction;
_deleteJobCommand.ExecuteNonQuery(); _deleteJobCommand.ExecuteNonQuery();
_deleteJobItemsCommand.GetParameter(index++).Value = new Guid(id); index = 0;
_deleteJobItemsCommand.GetParameter(index++).Value = id;
_deleteJobItemsCommand.Transaction = transaction; _deleteJobItemsCommand.Transaction = transaction;
_deleteJobItemsCommand.ExecuteNonQuery(); _deleteJobItemsCommand.ExecuteNonQuery();
@ -607,11 +608,16 @@ namespace MediaBrowser.Server.Implementations.Sync
var info = new SyncJobItem var info = new SyncJobItem
{ {
Id = reader.GetGuid(0).ToString("N"), Id = reader.GetGuid(0).ToString("N"),
ItemId = reader.GetString(1), ItemId = reader.GetString(1)
MediaSourceId = reader.GetString(2),
JobId = reader.GetString(3)
}; };
if (!reader.IsDBNull(2))
{
info.MediaSourceId = reader.GetString(2);
}
info.JobId = reader.GetString(3);
if (!reader.IsDBNull(4)) if (!reader.IsDBNull(4))
{ {
info.OutputPath = reader.GetString(4); info.OutputPath = reader.GetString(4);

@ -1,6 +1,5 @@
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller; using MediaBrowser.Controller;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.ApiClient; using MediaBrowser.Model.ApiClient;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;

@ -67,7 +67,7 @@ namespace MediaBrowser.Server.Mac
return list; return list;
} }
public void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory) public void AuthorizeServer(int udpPort, int httpServerPort, string tempDirectory)
{ {
} }

@ -1,5 +1,4 @@
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.IsoMounter; using MediaBrowser.IsoMounter;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Mono.Networking; using MediaBrowser.Server.Mono.Networking;
@ -84,7 +83,7 @@ namespace MediaBrowser.Server.Mono.Native
return list; return list;
} }
public void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory) public void AuthorizeServer(int udpPort, int httpServerPort, string tempDirectory)
{ {
} }

@ -1,6 +1,5 @@
using MediaBrowser.Common.Implementations.Networking; using MediaBrowser.Common.Implementations.Networking;
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;

@ -224,7 +224,7 @@ namespace MediaBrowser.Server.Startup.Common
private readonly StartupOptions _startupOptions; private readonly StartupOptions _startupOptions;
private readonly string _remotePackageName; private readonly string _remotePackageName;
private readonly bool _supportsNativeWebSocket; private bool _supportsNativeWebSocket;
internal INativeApp NativeApp { get; set; } internal INativeApp NativeApp { get; set; }
@ -454,6 +454,18 @@ namespace MediaBrowser.Server.Startup.Common
RegisterSingleInstance<ISearchEngine>(() => new SearchEngine(LogManager, LibraryManager, UserManager)); RegisterSingleInstance<ISearchEngine>(() => new SearchEngine(LogManager, LibraryManager, UserManager));
if (IsFirstRun)
{
ServerConfigurationManager.Configuration.EnableWin8HttpListener = false;
ServerConfigurationManager.SaveConfiguration();
_supportsNativeWebSocket = false;
}
if (!ServerConfigurationManager.Configuration.EnableWin8HttpListener)
{
_supportsNativeWebSocket = false;
}
HttpServer = ServerFactory.CreateServer(this, LogManager, "Media Browser", WebApplicationName, "dashboard/index.html", _supportsNativeWebSocket); HttpServer = ServerFactory.CreateServer(this, LogManager, "Media Browser", WebApplicationName, "dashboard/index.html", _supportsNativeWebSocket);
RegisterSingleInstance(HttpServer, false); RegisterSingleInstance(HttpServer, false);
progress.Report(10); progress.Report(10);
@ -470,7 +482,7 @@ namespace MediaBrowser.Server.Startup.Common
ImageProcessor = new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, MediaEncoder); ImageProcessor = new ImageProcessor(LogManager.GetLogger("ImageProcessor"), ServerConfigurationManager.ApplicationPaths, FileSystemManager, JsonSerializer, MediaEncoder);
RegisterSingleInstance(ImageProcessor); RegisterSingleInstance(ImageProcessor);
SyncManager = new SyncManager(LibraryManager, SyncRepository, ImageProcessor, LogManager.GetLogger("SyncManager"), UserManager, DtoService, this); SyncManager = new SyncManager(LibraryManager, SyncRepository, ImageProcessor, LogManager.GetLogger("SyncManager"), UserManager, () => DtoService, this);
RegisterSingleInstance(SyncManager); RegisterSingleInstance(SyncManager);
DtoService = new DtoService(Logger, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, SyncManager, this); DtoService = new DtoService(Logger, LibraryManager, UserDataManager, ItemRepository, ImageProcessor, ServerConfigurationManager, FileSystemManager, ProviderManager, () => ChannelManager, SyncManager, this);
@ -735,7 +747,7 @@ namespace MediaBrowser.Server.Startup.Common
ServerManager.AddWebSocketListeners(GetExports<IWebSocketListener>(false)); ServerManager.AddWebSocketListeners(GetExports<IWebSocketListener>(false));
StartServer(true); StartServer();
LibraryManager.AddParts(GetExports<IResolverIgnoreRule>(), LibraryManager.AddParts(GetExports<IResolverIgnoreRule>(),
GetExports<IVirtualFolderCreator>(), GetExports<IVirtualFolderCreator>(),
@ -773,8 +785,7 @@ namespace MediaBrowser.Server.Startup.Common
/// <summary> /// <summary>
/// Starts the server. /// Starts the server.
/// </summary> /// </summary>
/// <param name="retryOnFailure">if set to <c>true</c> [retry on failure].</param> private void StartServer()
private void StartServer(bool retryOnFailure)
{ {
try try
{ {
@ -784,18 +795,9 @@ namespace MediaBrowser.Server.Startup.Common
{ {
Logger.ErrorException("Error starting http server", ex); Logger.ErrorException("Error starting http server", ex);
if (retryOnFailure)
{
RegisterServerWithAdministratorAccess();
StartServer(false);
}
else
{
throw; throw;
} }
} }
}
/// <summary> /// <summary>
/// Called when [configuration updated]. /// Called when [configuration updated].
@ -1070,9 +1072,8 @@ namespace MediaBrowser.Server.Startup.Common
try try
{ {
NativeApp.AuthorizeServer( NativeApp.AuthorizeServer(
ServerConfigurationManager.Configuration.HttpServerPortNumber,
HttpServerUrlPrefixes.First(),
UdpServerEntryPoint.PortNumber, UdpServerEntryPoint.PortNumber,
ServerConfigurationManager.Configuration.HttpServerPortNumber,
ConfigurationManager.CommonApplicationPaths.TempDirectory); ConfigurationManager.CommonApplicationPaths.TempDirectory);
} }
catch (Exception ex) catch (Exception ex)

@ -1,5 +1,4 @@
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
@ -17,11 +16,10 @@ namespace MediaBrowser.Server.Startup.Common
/// <summary> /// <summary>
/// Authorizes the server. /// Authorizes the server.
/// </summary> /// </summary>
/// <param name="httpServerPort">The HTTP server port.</param>
/// <param name="httpServerUrlPrefix">The HTTP server URL prefix.</param>
/// <param name="udpPort">The UDP port.</param> /// <param name="udpPort">The UDP port.</param>
/// <param name="httpServerPort">The HTTP server port.</param>
/// <param name="tempDirectory">The temporary directory.</param> /// <param name="tempDirectory">The temporary directory.</param>
void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory); void AuthorizeServer(int udpPort, int httpServerPort, string tempDirectory);
/// <summary> /// <summary>
/// Gets the environment. /// Gets the environment.

@ -1,21 +1,15 @@
rem %1 = http server port rem %1 = udp server port
rem %2 = http server url rem %2 = http server port
rem %3 = udp server port
if [%1]==[] GOTO DONE if [%1]==[] GOTO DONE
netsh advfirewall firewall delete rule name="Port %1" protocol=TCP localport=%1 netsh advfirewall firewall delete rule name="Port %1" protocol=UDP localport=%1
netsh advfirewall firewall add rule name="Port %1" dir=in action=allow protocol=TCP localport=%1 netsh advfirewall firewall add rule name="Port %1" dir=in action=allow protocol=UDP localport=%1
if [%2]==[] GOTO DONE if [%2]==[] GOTO DONE
netsh http del urlacl url="%2" user="NT AUTHORITY\Authenticated Users" netsh advfirewall firewall delete rule name="Port %2" protocol=TCP localport=%2
netsh http add urlacl url="%2" user="NT AUTHORITY\Authenticated Users" netsh advfirewall firewall add rule name="Port %2" dir=in action=allow protocol=TCP localport=%2
if [%3]==[] GOTO DONE
netsh advfirewall firewall delete rule name="Port %3" protocol=UDP localport=%3
netsh advfirewall firewall add rule name="Port %3" dir=in action=allow protocol=UDP localport=%3
:DONE :DONE

@ -13,11 +13,10 @@ namespace MediaBrowser.ServerApplication.Native
/// <summary> /// <summary>
/// Authorizes the server. /// Authorizes the server.
/// </summary> /// </summary>
/// <param name="httpServerPort">The HTTP server port.</param>
/// <param name="httpServerUrlPrefix">The HTTP server URL prefix.</param>
/// <param name="udpPort">The UDP port.</param> /// <param name="udpPort">The UDP port.</param>
/// <param name="httpServerPort">The HTTP server port.</param>
/// <param name="tempDirectory">The temp directory.</param> /// <param name="tempDirectory">The temp directory.</param>
public static void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory) public static void AuthorizeServer(int udpPort, int httpServerPort, string tempDirectory)
{ {
Directory.CreateDirectory(tempDirectory); Directory.CreateDirectory(tempDirectory);
@ -37,9 +36,7 @@ namespace MediaBrowser.ServerApplication.Native
{ {
FileName = tmpFile, FileName = tmpFile,
Arguments = string.Format("{0} {1} {2}", httpServerPort, Arguments = string.Format("{0} {1}", udpPort, httpServerPort),
httpServerUrlPrefix,
udpPort),
CreateNoWindow = true, CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden, WindowStyle = ProcessWindowStyle.Hidden,

@ -1,5 +1,4 @@
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.IsoMounter; using MediaBrowser.IsoMounter;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Startup.Common; using MediaBrowser.Server.Startup.Common;
@ -22,9 +21,9 @@ namespace MediaBrowser.ServerApplication.Native
return list; return list;
} }
public void AuthorizeServer(int httpServerPort, string httpServerUrlPrefix, int udpPort, string tempDirectory) public void AuthorizeServer(int httpServerPort, int udpPort, string tempDirectory)
{ {
ServerAuthorization.AuthorizeServer(httpServerPort, httpServerUrlPrefix, udpPort, tempDirectory); ServerAuthorization.AuthorizeServer(udpPort, httpServerPort, tempDirectory);
} }
public NativeEnvironment Environment public NativeEnvironment Environment

@ -1,6 +1,5 @@
using MediaBrowser.Common.Implementations.Networking; using MediaBrowser.Common.Implementations.Networking;
using MediaBrowser.Common.Net; using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Net;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.532</version> <version>3.0.533</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.532" /> <dependency id="MediaBrowser.Common" version="3.0.533" />
<dependency id="NLog" version="3.1.0.0" /> <dependency id="NLog" version="3.1.0.0" />
<dependency id="SimpleInjector" version="2.6.1" /> <dependency id="SimpleInjector" version="2.6.1" />
<dependency id="sharpcompress" version="0.10.2" /> <dependency id="sharpcompress" version="0.10.2" />

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.532</version> <version>3.0.533</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Model.Signed</id> <id>MediaBrowser.Model.Signed</id>
<version>3.0.532</version> <version>3.0.533</version>
<title>MediaBrowser.Model - Signed Edition</title> <title>MediaBrowser.Model - Signed Edition</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.532</version> <version>3.0.533</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.532" /> <dependency id="MediaBrowser.Common" version="3.0.533" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

Loading…
Cancel
Save