diff --git a/Dotnet/ImageCache.cs b/Dotnet/ImageCache.cs index 5717daf7..5b1f4f27 100644 --- a/Dotnet/ImageCache.cs +++ b/Dotnet/ImageCache.cs @@ -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); } diff --git a/Dotnet/WebApi.cs b/Dotnet/WebApi.cs index a9180cc8..c93579be 100644 --- a/Dotnet/WebApi.cs +++ b/Dotnet/WebApi.cs @@ -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) diff --git a/src/mixins/tabs/feed.pug b/src/mixins/tabs/feed.pug index 083e84ff..53c6fa1f 100644 --- a/src/mixins/tabs/feed.pug +++ b/src/mixins/tabs/feed.pug @@ -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')