qol: simplify calls
This commit is contained in:
@@ -82,7 +82,7 @@ namespace Disco.Services.Interop.DiscoServices
|
||||
};
|
||||
var requestJson = JsonConvert.SerializeObject(body);
|
||||
|
||||
using (var request = new ByteArrayContent(System.Text.Encoding.UTF8.GetBytes(requestJson)))
|
||||
using (var request = new ByteArrayContent(Encoding.UTF8.GetBytes(requestJson)))
|
||||
{
|
||||
request.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Disco.Services.Interop.DiscoServices
|
||||
{
|
||||
Attachments
|
||||
.Select(a => new { Attachment = a, Filename = AttachmentFilenameRetriever(a, Database) })
|
||||
.Where(a => System.IO.File.Exists(a.Filename))
|
||||
.Where(a => File.Exists(a.Filename))
|
||||
.Select((a, i) => new { Attachment = a.Attachment, Filename = a.Filename, Index = i })
|
||||
.ToList()
|
||||
.ForEach(a =>
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Disco.Services.Interop.DiscoServices
|
||||
var appVersion = typeof(LicenseValidationTask).Assembly.GetName().Version.ToString(4);
|
||||
var updateUrl = $"{DiscoServiceHelpers.ServicesUrl}API/License/V1";
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(updateUrl);
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(updateUrl);
|
||||
|
||||
// Fix for Proxy Servers which don't support KeepAlive
|
||||
request.KeepAlive = false;
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Disco.Services.Interop.DiscoServices
|
||||
|
||||
var manifestJson = JsonConvert.SerializeObject(result, Formatting.Indented);
|
||||
|
||||
var manifestFile = PluginLibrary.ManifestFilename(Database);
|
||||
var manifestFile = ManifestFilename(Database);
|
||||
|
||||
if (!Directory.Exists(Path.GetDirectoryName(manifestFile)))
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(manifestFile));
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Disco.Services.Interop.DiscoServices
|
||||
|
||||
var discoVersion = CurrentDiscoVersionFormatted();
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(UpdateUrl());
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(UpdateUrl());
|
||||
|
||||
// Fix for Proxy Servers which don't support KeepAlive
|
||||
request.KeepAlive = false;
|
||||
@@ -223,7 +223,7 @@ namespace Disco.Services.Interop.DiscoServices
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
m.InstalledPlugins = Disco.Services.Plugins.Plugins.GetPlugins().Select(manifest => new StatisticString() { Key = manifest.Id, Value = manifest.VersionFormatted }).ToList();
|
||||
m.InstalledPlugins = Plugins.Plugins.GetPlugins().Select(manifest => new StatisticString() { Key = manifest.Id, Value = manifest.VersionFormatted }).ToList();
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user