public async void GetDetail()
        {
            if (SearchResult == null)
            {
                Growl.Error(Language.Get("strmsgPleaseSearchFirst"), Global.TOKEN_MAIN);
                return;
            }

            ShowWait = true;

            string id           = null;
            eType  type         = eType.NONE;
            string selectHeader = ((System.Windows.Controls.TabItem)((SearchView)this.View).ctrSearchTab.SelectedItem).Header.ToString();

            if (selectHeader == Language.Get("strALBUM"))
            {
                if (((SearchView)this.View).ctrAlbumGrid.SelectedIndex < 0)
                {
                    goto ERR_NO_SELECT;
                }
                id   = SearchResult.Albums[((SearchView)this.View).ctrAlbumGrid.SelectedIndex].ID.ToString();
                type = eType.ALBUM;
            }
            else if (selectHeader == Language.Get("strTRACK"))
            {
                if (((SearchView)this.View).ctrTrackGrid.SelectedIndex < 0)
                {
                    goto ERR_NO_SELECT;
                }
                id   = SearchResult.Tracks[((SearchView)this.View).ctrTrackGrid.SelectedIndex].ID.ToString();
                type = eType.TRACK;
            }
            else if (selectHeader == Language.Get("strVIDEO"))
            {
                if (((SearchView)this.View).ctrVideoGrid.SelectedIndex < 0)
                {
                    goto ERR_NO_SELECT;
                }
                id   = SearchResult.Videos[((SearchView)this.View).ctrVideoGrid.SelectedIndex].ID.ToString();
                type = eType.VIDEO;
            }
            else if (selectHeader == Language.Get("strARTISTS"))
            {
                if (((SearchView)this.View).ctrArtistGrid.SelectedIndex < 0)
                {
                    goto ERR_NO_SELECT;
                }
                id   = SearchResult.Artists[((SearchView)this.View).ctrArtistGrid.SelectedIndex].ID.ToString();
                type = eType.ARTIST;
            }
            else if (selectHeader == Language.Get("strPLAYLIST"))
            {
                if (((SearchView)this.View).ctrPlaylistGrid.SelectedIndex < 0)
                {
                    goto ERR_NO_SELECT;
                }
                id   = SearchResult.Playlists[((SearchView)this.View).ctrPlaylistGrid.SelectedIndex].UUID;
                type = eType.PLAYLIST;
            }

            (string msg, eType otype, object data) = await Client.Get(Global.CommonKey, id, type, Global.Settings.SearchNum, Global.Settings.IncludeEP, false);

            Detail     = Detail.Creat(data, type);
            ShowDetail = true;
            ShowList   = false;
            ShowWait   = false;
            return;

ERR_NO_SELECT:
            Growl.Error(Language.Get("strmsgPleaseSelectOneItem"), Global.TOKEN_MAIN);
            ShowWait = false;
            return;
        }
Example #2
0
 public void SetTrack(Detail detail, Track track)
 {
     BasePath = Tools.GetAlbumPath(track.Album, Settings);
     Items.Add(new TrackTask((Track)detail.Data, Items.Count + 1, Settings, RecieveDownloadOver, track.Album));
 }
Example #3
0
 public void SetVideo(Detail detail, Video video)
 {
     BasePath = Tools.GetVideoPath(Settings, video, null);
     BasePath = Path.GetDirectoryName(BasePath);
     Items.Add(new VideoTask((Video)detail.Data, Items.Count + 1, Settings, RecieveDownloadOver, video.Album));
 }
Example #4
0
 public void AddTask(Detail detail)
 {
     DownloadList.Insert(0, new TaskViewModel(detail, this));
     SelectPage("download");
 }