Exemplo n.º 1
0
        void torrentDetailsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            TorrentDetails det = e.Result as TorrentDetails;

            // show files
            dgTorrentFiles.ItemsSource = det.TorrentFiles;

            // show details
            SetAttachedSeries(det.AnimeSeries);
        }
Exemplo n.º 2
0
        void torrentDetailsWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            Torrent            tor   = e.Argument as Torrent;
            List <TorrentFile> files = VM_UTorrentHelper.Instance.GetFilesForTorrent(tor.Hash);

            TorrentDetails det = new TorrentDetails();

            det.TorrentFiles = files;

            // try and find the series
            foreach (VM_AniDB_Anime anime in VM_AniDB_Anime.BestLevenshteinDistanceMatchesCache(tor.ClosestAnimeMatchString, 10))
            {
                // get the series for the anime
                VM_AnimeSeries_User ser = VM_MainListHelper.Instance.GetSeriesForAnime(anime.AnimeID);
                if (ser != null)
                {
                    det.AnimeSeries = ser;
                    break;
                }
            }

            e.Result = det;
        }