public SongListInfoPage(ISongList songlist) { InitializeComponent(); this.Dispatcher.BeginInvoke(new Action(() => { (this.DataContext as SongListInfoPageViewModel).GetInfo(songlist); })); }
public PlatformInfoModel(ISongList songlist) { Id = songlist.Id; Musics = songlist.Musics; CoverUrl = songlist.CoverUrl; Origin = songlist.Origin; SourceName = songlist.SourceName; Title = songlist.Title; }
public async void ClickImportExecute() { //获取类型 MusicSource source; if (ChooseKugou) { source = MusicSource.Kugou; } else if (ChooseNetease) { source = MusicSource.Netease; } else { source = MusicSource.Tencent; } ISongList songList = null; bool isError = false; await Task.Run(() => { Thread.Sleep(300); ImportButtonVisibility = Visibility.Hidden; LoadingButtonVisibility = Visibility.Visible; try { songList = CoreApi.GetPlatformSongList(source, ImportUrl); } catch { isError = true; } ImportButtonVisibility = Visibility.Visible; LoadingButtonVisibility = Visibility.Hidden; }); if (isError) { Toast.Show("导入失败!", Toast.InfoType.Error); } else { new PlatformInfoManager().Insert(new PlatformInfoModel(songList)); foreach (var item in songList.Musics) { new PlatformListManager().Insert(new PlatformListModel { MusicId = item.Id, PlatformId = songList.Id }); new MusicInfoManager().Insert(new MusicInfoModel(item)); } ViewModelManager.BasePageViewModel.RefreshPlatformList(); Toast.Show("导入成功!", Toast.InfoType.Success); } }
public static List <SongDto> GetFollowingSongs(this ISongList songList, int count) { var list = new List <SongDto> { songList.CurrentSong }; for (int i = 0; i < count - 1; i++) { list.Add(songList.MoveNext().CurrentSong); } return(list); }
public static bool CanEditSongList(IUserPermissionContext permissionContext, ISongList songList) { if (songList.FeaturedList && CanManageFeaturedLists(permissionContext)) { return(true); } if (permissionContext.HasPermission(PermissionToken.EditAllSongLists)) { return(true); } return(songList.Author.IsTheSameUser(permissionContext.LoggedUser)); }
public async void GetInfo(ISongList songlist) { this.SongList = songlist; SongListInfoContent content = await ServiceProvider.GetService <ISongListService>().GedanInfoAsync(this.SongList.ListId); if (!content.HasError) { foreach (var song in content.Songs) { this.Songs.Add(song); } this.PictureUrl = content.PictureS500; } }
public void PlaySongList(ISongList songlist) { throw new NotImplementedException(); }
public SongListPresenter(ISongList param) { view = param; }