示例#1
0
        public async void Populate()
        {
            if (SubsonicService.HasValidSubsonicUrl)
            {
                await SubsonicService.GetMusicFolders().WithErrorHandler(this).OnSuccess(SetMenuItems).Execute();

                if (MenuItems.Count == 1)
                {
                    NavigationService.NavigateToViewModel <IndexViewModel>(MenuItems[0].Item.Id);
                }
            }
            else
            {
                await ShowSettingsNotFoundDialog();

                DialogService.ShowSettings <SettingsViewModel>();
            }
        }
        public void GetMusicFoldersAlwaysReturnsAGetRootResult()
        {
            var result = _subject.GetMusicFolders();

            result.Should().BeOfType <GetRootResult>();
        }
示例#3
0
        public async Task <IActionResult> GetMusicFolders(SubsonicRequest request)
        {
            var result = await SubsonicService.GetMusicFolders(request).ConfigureAwait(false);

            return(BuildResponse(request, result, "musicFolders"));
        }
示例#4
0
 protected override async Task AfterPopulate(int id)
 {
     var result = SubsonicService.GetMusicFolders();
     await result.WithErrorHandler(ErrorDialogViewModel).OnSuccess(r => SetIndexName(r, id)).Execute();
 }
示例#5
0
 protected override IServiceResultBase <IList <MusicFolder> > GetResult(bool parameter)
 {
     return(SubsonicService.GetMusicFolders());
 }
示例#6
0
 protected override async Task AfterLoadModel(int id)
 {
     var result = SubsonicService.GetMusicFolders();
     await result.WithErrorHandler(this).OnSuccess(r => SetIndexName(r, id)).Execute();
 }