Exemple #1
0
        private async Task GetImdbDetails(string filename)
        {
            if (!Settings.Default.SearchMethods.HasFlag(SearchMethod.Imdb))
            {
                return;
            }

            var vi = VideoInfo.Extract(filename);

            if (vi.Type == VideoType.Undefined)
            {
                return;
            }

            StatusText = "Retrieving IMDb details...";
            OmdbResponse response = new OmdbResponse();

            switch (vi.Type)
            {
            case VideoType.Movie:
                response = await omdbClient.SearchMovieAsync(vi.Title, vi.Year);

                break;

            case VideoType.Episode:
                response = await omdbClient.SearchEpisodeAsync(vi.Title, vi.Season, vi.Episode);

                break;
            }

            if (response.Success)
            {
                imdbIdTextBox.Text = response.ImdbIdTrimmed;
            }
        }