77 lines
2.5 KiB
Text
77 lines
2.5 KiB
Text
@page "/FirstTimeSetup/Metadata"
|
|
@layout FirstTimeSetupLayout
|
|
@inject SetupService SetupService
|
|
@inject NavigationManager NavigationManager
|
|
@inject IMessageService MessageService
|
|
@inject ILogger<Index> Logger
|
|
|
|
<PageTitle>Metadata Connections - First Time Setup</PageTitle>
|
|
|
|
<Form Model="@Settings" Loading="Loading" OnFinish="ValidateMetadataConnections" Layout="FormLayout.Vertical">
|
|
<FormItem>
|
|
LANCommander has the ability to pull metadata and media from external sources. Required credentials can be added here, or can be set later in Settings.
|
|
</FormItem>
|
|
|
|
<Divider Text="IGDB Credentials" />
|
|
|
|
<p>
|
|
<Text Type="TextElementType.Secondary">In order to use IGDB metadata, you need a Twitch developer account. <a href="https://api-docs.igdb.com/#account-creation" target="_blank">Click here</a> for more details.</Text>
|
|
</p>
|
|
|
|
<FormItem Label="Client ID">
|
|
<Input @bind-Value="context.IGDBClientId" />
|
|
</FormItem>
|
|
<FormItem Label="Client Secret">
|
|
<InputPassword @bind-Value="context.IGDBClientSecret" AutoComplete="false" />
|
|
</FormItem>
|
|
|
|
<Divider Text="SteamGridDB Credentials" />
|
|
|
|
<p>
|
|
<Text Type="TextElementType.Secondary">In order to automatically search SteamGridDB for media, you need an API key. <a href="https://www.steamgriddb.com/profile/preferences/api" target="_blank">Click here</a> to get your key.</Text>
|
|
</p>
|
|
|
|
<FormItem Label="API Key">
|
|
<InputPassword @bind-Value="context.Media.SteamGridDbApiKey" AutoComplete="false" />
|
|
</FormItem>
|
|
|
|
<FormItem>
|
|
<GridRow Justify="RowJustify.End" Style="margin-top: 16px;">
|
|
<GridCol>
|
|
<Button Type="ButtonType.Primary" HtmlType="submit">
|
|
Save
|
|
</Button>
|
|
</GridCol>
|
|
</GridRow>
|
|
</FormItem>
|
|
</Form>
|
|
|
|
@code {
|
|
[CascadingParameter]
|
|
FirstTimeSetupLayout Layout { get; set; }
|
|
|
|
Settings Settings;
|
|
|
|
bool Loading = false;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
var isSetupInitialized = await SetupService.IsSetupInitialized();
|
|
if (isSetupInitialized)
|
|
{
|
|
NavigationManager.NavigateTo("/");
|
|
return;
|
|
}
|
|
|
|
await Layout.ChangeCurrentStep(FirstTimeSetupStep.Metadata);
|
|
|
|
Settings = SettingService.GetSettings();
|
|
}
|
|
|
|
async Task ValidateMetadataConnections()
|
|
{
|
|
SettingService.SaveSettings(Settings);
|
|
|
|
NavigationManager.NavigateTo("/FirstTimeSetup/Administrator");
|
|
}
|
|
}
|