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" />
+8
View File
@@ -312,6 +312,8 @@
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
try
{
await _jsRuntime.InvokeVoidAsync("sortableCollection", Id);
if (_data.UseCustomPlaybackOrder)
@@ -322,6 +324,12 @@
{
await _jsRuntime.InvokeVoidAsync("disableSorting");
}
}
catch (Exception)
{
// ignored
}
await base.OnAfterRenderAsync(firstRender);
}
+7
View File
@@ -34,9 +34,16 @@ namespace ErsatzTV.Pages
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
try
{
await NavManager.NavigateToFragmentAsync(JsRuntime);
}
catch (Exception)
{
// ignored
}
}
}
[SuppressMessage("ReSharper", "VSTHRD100")]
+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();
@@ -179,9 +179,16 @@
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
try
{
await _navigationManager.NavigateToFragmentAsync(_jsRuntime);
}
catch (Exception)
{
// ignored
}
}
}
protected override Task OnParametersSetAsync() => RefreshData();
+11 -2
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;
@@ -47,9 +48,17 @@ namespace ErsatzTV.Shared
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
try
{
await JsRuntime.InvokeVoidAsync("styleMarkdown");
await base.OnAfterRenderAsync(firstRender);
}
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;