123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using FNZCM.BlazorWasm.Helpers;
- using FNZCM.Shared.MediaModels;
- using FNZCM.Shared.MetadataModels;
- namespace FNZCM.BlazorWasm.UI
- {
- public partial class App
- {
- private string LoadingMessage { get; set; }
- private LoadingProgress Progress { get; set; }
- protected override async Task OnInitializedAsync()
- {
- base.OnInitialized();
- do
- {
- Progress = await ApiClient.GetProgress();
- StateHasChanged();
- if (Progress?.IsLoading == false) break;
- Thread.Sleep(1000);
- } while (true);
- LoadingMessage = "Fetching fileset...";
- StateHasChanged();
- Dictionary<string, Library> Libraries = null;
- Dictionary<string, MediaTag> MediaTags = null;
- TimeoutHelper.SetTimeout(1, async () =>
- {
- Libraries = await ApiClient.GetLibraries();
- LoadingMessage = "Fetching tags...";
- StateHasChanged();
- }, async () =>
- {
- MediaTags = await ApiClient.GetMediaTags();
- LoadingMessage = "Processing model...";
- StateHasChanged();
- }, async () =>
- {
- FnzDataSet.InitFeModules2(ApiClient.ApiBase, Libraries, MediaTags);
- LoadingMessage = null;
- StateHasChanged();
- });
- }
- }
- }
|