Browse Source

minor ui fixes (#668)

* remove unused package

* fix controller name

* catch and ignore jsruntime exceptions

* separate debug stage from public stage
pull/669/head
Jason Dove 4 years ago committed by GitHub
parent
commit
2058c44949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      ErsatzTV/Controllers/ArtworkController.cs
  2. 1
      ErsatzTV/ErsatzTV.csproj
  3. 18
      ErsatzTV/Pages/CollectionItems.razor
  4. 9
      ErsatzTV/Pages/FragmentNavigationBase.cs
  5. 12
      ErsatzTV/Pages/PlexMediaSources.razor
  6. 9
      ErsatzTV/Pages/TelevisionEpisodeList.razor
  7. 15
      ErsatzTV/Shared/MarkdownView.razor.cs
  8. 8
      ErsatzTV/Startup.cs

4
ErsatzTV/Controllers/ArtworkController.cs

@ -25,12 +25,12 @@ namespace ErsatzTV.Controllers @@ -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
ErsatzTV/ErsatzTV.csproj

@ -11,7 +11,6 @@ @@ -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" />

18
ErsatzTV/Pages/CollectionItems.razor

@ -313,15 +313,23 @@ @@ -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);
}

9
ErsatzTV/Pages/FragmentNavigationBase.cs

@ -35,7 +35,14 @@ namespace ErsatzTV.Pages @@ -35,7 +35,14 @@ namespace ErsatzTV.Pages
{
if (firstRender)
{
await NavManager.NavigateToFragmentAsync(JsRuntime);
try
{
await NavManager.NavigateToFragmentAsync(JsRuntime);
}
catch (Exception)
{
// ignored
}
}
}

12
ErsatzTV/Pages/PlexMediaSources.razor

@ -125,7 +125,17 @@ @@ -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();

9
ErsatzTV/Pages/TelevisionEpisodeList.razor

@ -180,7 +180,14 @@ @@ -180,7 +180,14 @@
{
if (firstRender)
{
await _navigationManager.NavigateToFragmentAsync(_jsRuntime);
try
{
await _navigationManager.NavigateToFragmentAsync(_jsRuntime);
}
catch (Exception)
{
// ignored
}
}
}

15
ErsatzTV/Shared/MarkdownView.razor.cs

@ -1,4 +1,5 @@ @@ -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 @@ -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);
}
}
}

8
ErsatzTV/Startup.cs

@ -4,7 +4,6 @@ using System.IO; @@ -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 @@ -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 @@ -139,7 +142,6 @@ namespace ErsatzTV
services.AddMudServices();
services.AddCourier(Assembly.GetAssembly(typeof(LibraryScanProgress)));
services.AddBlazoredLocalStorage();
Console.OutputEncoding = Encoding.UTF8;

Loading…
Cancel
Save