[CHANGE] Added video info page
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
@inject ISnackbar Snackbar
|
||||
@inject ClientService ClientService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<MudText>Video data</MudText>
|
||||
<MudStack Row Spacing="2">
|
||||
|
||||
@@ -35,22 +35,6 @@ public partial class DevelopmentVideo : ComponentBase
|
||||
Snackbar.Add("Video ID needs to have an length of 11 chars!", Severity.Warning);
|
||||
}
|
||||
|
||||
var clientResult = await ClientService.LoadClientByIdAsync(_selectedClient.Id);
|
||||
if (!clientResult.IsSuccess)
|
||||
{
|
||||
Snackbar.Add(clientResult.Error?.Description ?? $"Failed to get client with id: {_selectedClient.Id}", Severity.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var ytClient = clientResult.Value;
|
||||
var videoResult = await ytClient.GetVideoByIdAsync(_videoId);
|
||||
if (!videoResult.IsSuccess)
|
||||
{
|
||||
Snackbar.Add(videoResult.Error?.Description ?? $"Failed to load video: {_videoId}", Severity.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var ytVideo = videoResult.Value;
|
||||
Snackbar.Add($"Loaded video {ytVideo.Title}", Severity.Success);
|
||||
NavigationManager.NavigateTo($"/video/{_videoId}?clientId={_selectedClient.Id}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user