mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
update docs
This commit is contained in:
parent
f346997992
commit
3ed1ac10cb
@ -869,25 +869,11 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||
Task<WebResponse> asyncTask = Task.Factory.FromAsync<WebResponse>(request.BeginGetResponse, request.EndGetResponse, null);
|
||||
|
||||
ThreadPool.RegisterWaitForSingleObject((asyncTask as IAsyncResult).AsyncWaitHandle, TimeoutCallback, request, timeout, true);
|
||||
asyncTask.ContinueWith(task =>
|
||||
{
|
||||
taskCompletion.TrySetResult(task.Result);
|
||||
|
||||
}, TaskContinuationOptions.NotOnFaulted);
|
||||
var callback = new TaskCallback { taskCompletion = taskCompletion };
|
||||
asyncTask.ContinueWith(callback.OnSuccess, TaskContinuationOptions.NotOnFaulted);
|
||||
|
||||
// Handle errors
|
||||
asyncTask.ContinueWith(task =>
|
||||
{
|
||||
if (task.Exception != null)
|
||||
{
|
||||
taskCompletion.TrySetException(task.Exception);
|
||||
}
|
||||
else
|
||||
{
|
||||
taskCompletion.TrySetException(new List<Exception>());
|
||||
}
|
||||
|
||||
}, TaskContinuationOptions.OnlyOnFaulted);
|
||||
asyncTask.ContinueWith(callback.OnError, TaskContinuationOptions.OnlyOnFaulted);
|
||||
|
||||
return taskCompletion.Task;
|
||||
}
|
||||
@ -903,5 +889,27 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class TaskCallback
|
||||
{
|
||||
public TaskCompletionSource<WebResponse> taskCompletion;
|
||||
|
||||
public void OnSuccess(Task<WebResponse> task)
|
||||
{
|
||||
taskCompletion.TrySetResult(task.Result);
|
||||
}
|
||||
|
||||
public void OnError(Task<WebResponse> task)
|
||||
{
|
||||
if (task.Exception != null)
|
||||
{
|
||||
taskCompletion.TrySetException(task.Exception);
|
||||
}
|
||||
else
|
||||
{
|
||||
taskCompletion.TrySetException(new List<Exception>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,15 +23,6 @@ namespace MediaBrowser.Server.Startup.Common.Browser
|
||||
OpenUrl(url, logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the github.
|
||||
/// </summary>
|
||||
/// <param name="logger">The logger.</param>
|
||||
public static void OpenGithub(ILogger logger)
|
||||
{
|
||||
OpenUrl("https://github.com/MediaBrowser/MediaBrowser", logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the community.
|
||||
/// </summary>
|
||||
@ -61,18 +52,6 @@ namespace MediaBrowser.Server.Startup.Common.Browser
|
||||
OpenDashboardPage("dashboard.html", appHost, logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the swagger.
|
||||
/// </summary>
|
||||
/// <param name="appHost">The app host.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
public static void OpenSwagger(IServerApplicationHost appHost, ILogger logger)
|
||||
{
|
||||
var url = appHost.GetLocalApiUrl("localhost") + "/swagger-ui/index.html";
|
||||
|
||||
OpenUrl(url, logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the URL.
|
||||
/// </summary>
|
||||
|
@ -21,9 +21,6 @@ namespace MediaBrowser.ServerApplication
|
||||
private ToolStripMenuItem cmdRestart;
|
||||
private ToolStripSeparator toolStripSeparator1;
|
||||
private ToolStripMenuItem cmdCommunity;
|
||||
private ToolStripMenuItem cmdApiDocs;
|
||||
private ToolStripMenuItem cmdSwagger;
|
||||
private ToolStripMenuItem cmdGtihub;
|
||||
|
||||
private readonly ILogger _logger;
|
||||
private readonly IServerApplicationHost _appHost;
|
||||
@ -66,9 +63,6 @@ namespace MediaBrowser.ServerApplication
|
||||
toolStripSeparator2 = new ToolStripSeparator();
|
||||
cmdConfigure = new ToolStripMenuItem();
|
||||
cmdBrowse = new ToolStripMenuItem();
|
||||
cmdApiDocs = new ToolStripMenuItem();
|
||||
cmdSwagger = new ToolStripMenuItem();
|
||||
cmdGtihub = new ToolStripMenuItem();
|
||||
|
||||
//
|
||||
// notifyIcon1
|
||||
@ -86,7 +80,6 @@ namespace MediaBrowser.ServerApplication
|
||||
toolStripSeparator2,
|
||||
cmdRestart,
|
||||
toolStripSeparator1,
|
||||
cmdApiDocs,
|
||||
cmdCommunity,
|
||||
cmdExit});
|
||||
contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
@ -128,24 +121,6 @@ namespace MediaBrowser.ServerApplication
|
||||
//
|
||||
cmdBrowse.Name = "cmdBrowse";
|
||||
cmdBrowse.Size = new System.Drawing.Size(208, 22);
|
||||
//
|
||||
// cmdApiDocs
|
||||
//
|
||||
cmdApiDocs.DropDownItems.AddRange(new ToolStripItem[] {
|
||||
cmdSwagger,
|
||||
cmdGtihub});
|
||||
cmdApiDocs.Name = "cmdApiDocs";
|
||||
cmdApiDocs.Size = new System.Drawing.Size(208, 22);
|
||||
//
|
||||
// cmdSwagger
|
||||
//
|
||||
cmdSwagger.Name = "cmdSwagger";
|
||||
cmdSwagger.Size = new System.Drawing.Size(136, 22);
|
||||
//
|
||||
// cmdGtihub
|
||||
//
|
||||
cmdGtihub.Name = "cmdGtihub";
|
||||
cmdGtihub.Size = new System.Drawing.Size(136, 22);
|
||||
|
||||
cmdExit.Click += cmdExit_Click;
|
||||
cmdRestart.Click += cmdRestart_Click;
|
||||
@ -153,9 +128,6 @@ namespace MediaBrowser.ServerApplication
|
||||
cmdCommunity.Click += cmdCommunity_Click;
|
||||
cmdBrowse.Click += cmdBrowse_Click;
|
||||
|
||||
cmdSwagger.Click += cmdSwagger_Click;
|
||||
cmdGtihub.Click += cmdGtihub_Click;
|
||||
|
||||
_configurationManager.ConfigurationUpdated += Instance_ConfigurationUpdated;
|
||||
|
||||
LocalizeText();
|
||||
@ -181,9 +153,6 @@ namespace MediaBrowser.ServerApplication
|
||||
|
||||
cmdExit.Text = _localization.GetLocalizedString("LabelExit");
|
||||
cmdCommunity.Text = _localization.GetLocalizedString("LabelVisitCommunity");
|
||||
cmdGtihub.Text = _localization.GetLocalizedString("LabelGithub");
|
||||
cmdSwagger.Text = _localization.GetLocalizedString("LabelApiDocumentation");
|
||||
cmdApiDocs.Text = _localization.GetLocalizedString("LabelDeveloperResources");
|
||||
cmdBrowse.Text = _localization.GetLocalizedString("LabelBrowseLibrary");
|
||||
cmdConfigure.Text = _localization.GetLocalizedString("LabelConfigureServer");
|
||||
cmdRestart.Text = _localization.GetLocalizedString("LabelRestartServer");
|
||||
@ -229,16 +198,6 @@ namespace MediaBrowser.ServerApplication
|
||||
_appHost.Shutdown();
|
||||
}
|
||||
|
||||
void cmdGtihub_Click(object sender, EventArgs e)
|
||||
{
|
||||
BrowserLauncher.OpenGithub(_logger);
|
||||
}
|
||||
|
||||
void cmdSwagger_Click(object sender, EventArgs e)
|
||||
{
|
||||
BrowserLauncher.OpenSwagger(_appHost, _logger);
|
||||
}
|
||||
|
||||
~ServerNotifyIcon()
|
||||
{
|
||||
Dispose();
|
||||
|
@ -299,9 +299,6 @@
|
||||
<Content Include="dashboard-ui\secondaryitems.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\serversecurity.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\shared.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
@ -1134,9 +1131,6 @@
|
||||
<Content Include="dashboard-ui\scripts\livetvsuggested.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\serversecurity.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\sync.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
Loading…
x
Reference in New Issue
Block a user