minor ui fixes (#668)

* remove unused package

* fix controller name

* catch and ignore jsruntime exceptions

* separate debug stage from public stage
This commit is contained in:
Jason Dove
2022-03-02 20:45:07 -06:00
committed by GitHub
parent 24ef5e68eb
commit 2058c44949
8 changed files with 59 additions and 17 deletions
+2 -2
View File
@@ -25,12 +25,12 @@ namespace ErsatzTV.Controllers
[ResponseCache(Duration = 3600)]
[ApiController]
[ApiExplorerSettings(IgnoreApi = true)]
public class PostersController : ControllerBase
public class ArtworkController : ControllerBase
{
private readonly IHttpClientFactory _httpClientFactory;
private readonly IMediator _mediator;
public PostersController(IMediator mediator, IHttpClientFactory httpClientFactory)
public ArtworkController(IMediator mediator, IHttpClientFactory httpClientFactory)
{
_mediator = mediator;
_httpClientFactory = httpClientFactory;
-1
View File
@@ -11,7 +11,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.2.0" />
<PackageReference Include="Bugsnag.AspNet.Core" Version="3.0.0" />
<PackageReference Include="FluentValidation" Version="10.3.6" />
<PackageReference Include="FluentValidation.AspNetCore" Version="10.3.6" />
+13 -5
View File
@@ -313,15 +313,23 @@
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await _jsRuntime.InvokeVoidAsync("sortableCollection", Id);
if (_data.UseCustomPlaybackOrder)
try
{
await _jsRuntime.InvokeVoidAsync("enableSorting");
await _jsRuntime.InvokeVoidAsync("sortableCollection", Id);
if (_data.UseCustomPlaybackOrder)
{
await _jsRuntime.InvokeVoidAsync("enableSorting");
}
else
{
await _jsRuntime.InvokeVoidAsync("disableSorting");
}
}
else
catch (Exception)
{
await _jsRuntime.InvokeVoidAsync("disableSorting");
// ignored
}
await base.OnAfterRenderAsync(firstRender);
}
+8 -1
View File
@@ -35,7 +35,14 @@ namespace ErsatzTV.Pages
{
if (firstRender)
{
await NavManager.NavigateToFragmentAsync(JsRuntime);
try
{
await NavManager.NavigateToFragmentAsync(JsRuntime);
}
catch (Exception)
{
// ignored
}
}
}
+11 -1
View File
@@ -125,7 +125,17 @@
{
Either<BaseError, string> maybeUrl = await _mediator.Send(new StartPlexPinFlow());
await maybeUrl.Match(
async url => await _jsRuntime.InvokeAsync<object>("open", new object[] { url, "_blank" }),
async url =>
{
try
{
await _jsRuntime.InvokeAsync<object>("open", new object[] { url, "_blank" });
}
catch (Exception)
{
// ignored
}
},
error =>
{
_locker.UnlockPlex();
+8 -1
View File
@@ -180,7 +180,14 @@
{
if (firstRender)
{
await _navigationManager.NavigateToFragmentAsync(_jsRuntime);
try
{
await _navigationManager.NavigateToFragmentAsync(_jsRuntime);
}
catch (Exception)
{
// ignored
}
}
}
+12 -3
View File
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using Ganss.XSS;
using Markdig;
using Microsoft.AspNetCore.Components;
@@ -48,8 +49,16 @@ namespace ErsatzTV.Shared
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await JsRuntime.InvokeVoidAsync("styleMarkdown");
await base.OnAfterRenderAsync(firstRender);
try
{
await JsRuntime.InvokeVoidAsync("styleMarkdown");
}
catch (Exception)
{
// ignored
}
await base.OnAfterRenderAsync(true);
}
}
}
+5 -3
View File
@@ -4,7 +4,6 @@ using System.IO;
using System.Reflection;
using System.Text;
using System.Threading.Channels;
using Blazored.LocalStorage;
using Bugsnag.AspNet.Core;
using Dapper;
using ErsatzTV.Application;
@@ -94,10 +93,14 @@ namespace ErsatzTV
?.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
?.InformationalVersion ?? "unknown";
configuration.NotifyReleaseStages = new[] { "public" };
configuration.NotifyReleaseStages = new[] { "public", "develop" };
#if DEBUG
configuration.ReleaseStage = "develop";
#else
// effectively "disable" by tweaking app config
configuration.ReleaseStage = bugsnagConfig.Enable ? "public" : "private";
#endif
});
services.AddCors(
@@ -139,7 +142,6 @@ namespace ErsatzTV
services.AddMudServices();
services.AddCourier(Assembly.GetAssembly(typeof(LibraryScanProgress)));
services.AddBlazoredLocalStorage();
Console.OutputEncoding = Encoding.UTF8;