mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
Fix empty notification images, Linux crash and feed GPS timer alignment
This commit is contained in:
@@ -69,7 +69,7 @@ internal static class ImageCache
|
|||||||
if (!string.IsNullOrEmpty(cookieString))
|
if (!string.IsNullOrEmpty(cookieString))
|
||||||
request.Headers.Add("Cookie", cookieString);
|
request.Headers.Add("Cookie", cookieString);
|
||||||
|
|
||||||
using var response = await httpClient.SendAsync(request);
|
var response = await httpClient.SendAsync(request);
|
||||||
response.EnsureSuccessStatusCode();
|
response.EnsureSuccessStatusCode();
|
||||||
return await response.Content.ReadAsStreamAsync();
|
return await response.Content.ReadAsStreamAsync();
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ internal static class ImageCache
|
|||||||
var directoryLocation = Path.Join(cacheLocation, fileId);
|
var directoryLocation = Path.Join(cacheLocation, fileId);
|
||||||
var fileLocation = Path.Join(directoryLocation, $"{version}.png");
|
var fileLocation = Path.Join(directoryLocation, $"{version}.png");
|
||||||
|
|
||||||
if (File.Exists(fileLocation))
|
if (File.Exists(fileLocation) && new FileInfo(fileLocation).Length > 0)
|
||||||
{
|
{
|
||||||
Directory.SetLastWriteTimeUtc(directoryLocation, DateTime.UtcNow);
|
Directory.SetLastWriteTimeUtc(directoryLocation, DateTime.UtcNow);
|
||||||
return fileLocation;
|
return fileLocation;
|
||||||
@@ -91,7 +91,7 @@ internal static class ImageCache
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var stream = await FetchImage(url);
|
await using var stream = await FetchImage(url);
|
||||||
await using var fileStream =
|
await using var fileStream =
|
||||||
new FileStream(fileLocation, FileMode.Create, FileAccess.Write, FileShare.None);
|
new FileStream(fileLocation, FileMode.Create, FileAccess.Write, FileShare.None);
|
||||||
await stream.CopyToAsync(fileStream);
|
await stream.CopyToAsync(fileStream);
|
||||||
@@ -111,7 +111,7 @@ internal static class ImageCache
|
|||||||
|
|
||||||
public static async Task SaveImageToFile(string url, string path)
|
public static async Task SaveImageToFile(string url, string path)
|
||||||
{
|
{
|
||||||
var stream = await FetchImage(url);
|
await using var stream = await FetchImage(url);
|
||||||
await using var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);
|
await using var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);
|
||||||
await stream.CopyToAsync(fileStream);
|
await stream.CopyToAsync(fileStream);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -40,7 +40,8 @@ namespace VRCX
|
|||||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||||
}
|
}
|
||||||
|
|
||||||
private WebApi()
|
// leave this as public, private makes nodeapi angry
|
||||||
|
public WebApi()
|
||||||
{
|
{
|
||||||
#if LINUX
|
#if LINUX
|
||||||
if (Instance == null)
|
if (Instance == null)
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ mixin feedTab
|
|||||||
template(#default='scope')
|
template(#default='scope')
|
||||||
div(style='position: relative; font-size: 14px')
|
div(style='position: relative; font-size: 14px')
|
||||||
template(v-if='scope.row.type === "GPS"')
|
template(v-if='scope.row.type === "GPS"')
|
||||||
location(v-if='scope.row.previousLocation' :location='scope.row.previousLocation')
|
location(
|
||||||
|
v-if='scope.row.previousLocation'
|
||||||
|
:location='scope.row.previousLocation'
|
||||||
|
style='display: inline-block')
|
||||||
el-tag(type='info' effect='plain' size='mini' style='margin-left: 5px') {{ timeToText(scope.row.time) }}
|
el-tag(type='info' effect='plain' size='mini' style='margin-left: 5px') {{ timeToText(scope.row.time) }}
|
||||||
br
|
br
|
||||||
span(style='margin-right: 5px')
|
span(style='margin-right: 5px')
|
||||||
|
|||||||
Reference in New Issue
Block a user