mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-05 14:26: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))
|
||||
request.Headers.Add("Cookie", cookieString);
|
||||
|
||||
using var response = await httpClient.SendAsync(request);
|
||||
var response = await httpClient.SendAsync(request);
|
||||
response.EnsureSuccessStatusCode();
|
||||
return await response.Content.ReadAsStreamAsync();
|
||||
}
|
||||
@@ -78,8 +78,8 @@ internal static class ImageCache
|
||||
{
|
||||
var directoryLocation = Path.Join(cacheLocation, fileId);
|
||||
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);
|
||||
return fileLocation;
|
||||
@@ -91,7 +91,7 @@ internal static class ImageCache
|
||||
|
||||
try
|
||||
{
|
||||
var stream = await FetchImage(url);
|
||||
await using var stream = await FetchImage(url);
|
||||
await using var fileStream =
|
||||
new FileStream(fileLocation, FileMode.Create, FileAccess.Write, FileShare.None);
|
||||
await stream.CopyToAsync(fileStream);
|
||||
@@ -111,7 +111,7 @@ internal static class ImageCache
|
||||
|
||||
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 stream.CopyToAsync(fileStream);
|
||||
}
|
||||
|
||||
+2
-1
@@ -40,7 +40,8 @@ namespace VRCX
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
|
||||
}
|
||||
|
||||
private WebApi()
|
||||
// leave this as public, private makes nodeapi angry
|
||||
public WebApi()
|
||||
{
|
||||
#if LINUX
|
||||
if (Instance == null)
|
||||
|
||||
@@ -31,7 +31,10 @@ mixin feedTab
|
||||
template(#default='scope')
|
||||
div(style='position: relative; font-size: 14px')
|
||||
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) }}
|
||||
br
|
||||
span(style='margin-right: 5px')
|
||||
|
||||
Reference in New Issue
Block a user