Exemplo n.º 1
0
        internal async void  GetTvShowData(string[] fileList, int tvDbId)
        {
            if (tvDbId == -1)
            {
                string tvShowName = null;
                if (fileList.Length > 0)
                {
                    tvShowName = GetTvShowFromFilePath(fileList.First());
                    tvShows shows = await GetTvShowsByNameAsync(tvShowName);

                    foreach (string filePath in fileList)
                    {
                        showEpisode ep = GetEpisodeInfoFromFile(filePath);
                        shows[0].AddEpisode(ep);
                    }
                }
                if (tvShowName != null)
                {
                    TvShows = await GetTvShowsByNameAsync(tvShowName);

                    actualTvDbID = TvShows[0].tvdbID;
                }
            }
            else
            {
                actualTvDbID = tvDbId;
                TvShows      = await GetTvShowsByTvDbIdAsync(tvDbId);
            }
            GetEpisodes();
        }
Exemplo n.º 2
0
        internal async Task <tvShows> GetTvShowsByTvDbIdAsync(int id)
        {
            var client = new TvDbClient();

            client.AcceptedLanguage = "de";
            await client.Authentication.AuthenticateAsync(Data.ApiKey, Data.UserName, Data.UserKey);

            var response = await client.Series.GetAsync(id);

            tvShows shows = new tvShows(response);

            return(shows);
        }
Exemplo n.º 3
0
        internal async Task <tvShows> GetTvShowsByNameAsync(string tvShowName)
        {
            var client = new TvDbClient();

            client.AcceptedLanguage = "de";
            await client.Authentication.AuthenticateAsync(Data.ApiKey, Data.UserName, Data.UserKey);

            var response = await client.Search.SearchSeriesByNameAsync(tvShowName);

            tvShows shows = new tvShows(response, tvShowName);

            return(shows);
        }
Exemplo n.º 4
0
 private void popListBox(tvShows show, int selIndex)
 {
     if (tvhelper.TvShows != null && tvhelper.TvShows.Count > 0)
     {
         lbTvShows.SelectedValueChanged -= new System.EventHandler(lbTvShows_SelectedValueChanged);
         lbTvShows.DataSource            = show;
         lbTvShows.DisplayMember         = "name";
         //lbTvShows.SelectedIndex = selIndex;
         lbTvShows.SelectedValueChanged += new System.EventHandler(lbTvShows_SelectedValueChanged);
         tvShow selectedShow = (tvShow)lbTvShows.SelectedItem;
         //tbTvdbId.Text = selectedShow.tvdbID.ToString();
         var test = tvhelper.TvShows;
         MessageBox.Show("Finish");
     }
 }