Пример #1
0
        private async Task GetSeriesData(bool includeSeasons)
        {
            var folder = tvwFolder.SelectedNode.Tag.ToString();
            await SeriesHelper.GetSeriesInfo(_tvdb, folder, includeSeasons).ConfigureAwait(false);

            this.InvokeUI(() => LoadAllFiles(folder));
            SetStatus($"Loaded series metadata for '{folder}'");
        }
Пример #2
0
        private async void MniTvdbSearch_Click(object sender, EventArgs e)
        {
            var folder     = tvwFolder.SelectedNode.Tag.ToString();
            var seriesName = new DirectoryInfo(folder).Name;

            using (var search = new SearchForm(_tvdb, seriesName))
            {
                if (search.ShowDialog() == DialogResult.OK)
                {
                    //create files
                    await SeriesHelper.GetSeriesInfo(_tvdb, folder, search.TvdbId, false);

                    //override selected poster
                    var posterFile = Path.Combine(folder, "folder.jpg");
                    var image      = ImageHelper.ReduceImageSize(search.Poster);
                    File.WriteAllBytes(posterFile, image);
                    LoadAllFiles(folder);

                    tvwFolder.SelectedNode.ImageKey         = HAS_ID_KEY;
                    tvwFolder.SelectedNode.SelectedImageKey = HAS_ID_KEY;
                }
            }
        }