예제 #1
0
        private List <TorrentFile> FindNew()
        {
            List <TorrentFile> newTorrents = new List <TorrentFile>();

            if (this.Torrents.Last != null && this.Torrents.Current != null)
            {
                foreach (TorrentFile currentTorrent in this.Torrents.Current)
                {
                    TorrentFile result = this.Torrents.Last.Find(item => item.Hash == currentTorrent.Hash);

                    if (result == null)
                    {
                        newTorrents.Add(currentTorrent);
                    }
                }
            }

            return(newTorrents);
        }
예제 #2
0
        private double _Remaining;    // in bytes

        public static TorrentFile ConvertStringArray(string[] file)
        {
            TorrentFile torrentFile = new TorrentFile();

            torrentFile.Hash              = file[0];
            torrentFile.Status            = Int32.Parse(file[1], CultureInfo.CurrentCulture);
            torrentFile.Name              = file[2];
            torrentFile.Size              = double.Parse(file[3], CultureInfo.CurrentCulture);
            torrentFile.PercentProgress   = Int32.Parse(file[4], CultureInfo.CurrentCulture);
            torrentFile.Downloaded        = double.Parse(file[5], CultureInfo.CurrentCulture);
            torrentFile.Uploaded          = double.Parse(file[6], CultureInfo.CurrentCulture);
            torrentFile.Ratio             = Int32.Parse(file[7], CultureInfo.CurrentCulture);
            torrentFile.UploadSpeed       = Int32.Parse(file[8], CultureInfo.CurrentCulture);
            torrentFile.DownloadSpeed     = Int32.Parse(file[9], CultureInfo.CurrentCulture);
            torrentFile.Eta               = Int32.Parse(file[10], CultureInfo.CurrentCulture);
            torrentFile.Label             = file[11];
            torrentFile.PeersConnected    = Int32.Parse(file[12], CultureInfo.CurrentCulture);
            torrentFile.PeersInSwarm      = Int32.Parse(file[13], CultureInfo.CurrentCulture);
            torrentFile.SeedsConnected    = Int32.Parse(file[14], CultureInfo.CurrentCulture);
            torrentFile.SeedsInSwarm      = Int32.Parse(file[15], CultureInfo.CurrentCulture);
            torrentFile.Availability      = double.Parse(file[16], CultureInfo.CurrentCulture);
            torrentFile.TorrentQueueOrder = Int32.Parse(file[17], CultureInfo.CurrentCulture);
            torrentFile.Remaining         = double.Parse(file[18], CultureInfo.CurrentCulture);
            torrentFile.TorrentSource     = "";
            torrentFile.RssFeed           = "";
            torrentFile.StatusString      = "";

            if (file.Length > 19)
            {
                torrentFile.TorrentSource = file[19];
                torrentFile.RssFeed       = file[20];
                torrentFile.StatusString  = file[21];
            }

            return(torrentFile);
        }
예제 #3
0
        public static TorrentFile ConvertStringArray(string[] file)
        {
            TorrentFile f = new TorrentFile();

            f.Hash                  = file[0];
            f.Status                = Int32.Parse(file[1]);
            f.Name                  = file[2];
            f.Size                  = double.Parse(file[3]);
            f.PercentProgress       = Int32.Parse(file[4]);
            f.Downloaded            = double.Parse(file[5]);
            f.Uploaded              = double.Parse(file[6]);
            f.Ratio                 = Int32.Parse(file[7]);
            f.UploadSpeed           = Int32.Parse(file[8]);
            f.DownloadSpeed         = Int32.Parse(file[9]);
            f.ETA                   = Int32.Parse(file[10]);
            f.Label                 = file[11];
            f.PeersConnected        = Int32.Parse(file[12]);
            f.PeersInSwarm          = Int32.Parse(file[13]);
            f.SeedsConnected        = Int32.Parse(file[14]);
            f.SeedsInSwarm          = Int32.Parse(file[15]);
            f.Availability          = double.Parse(file[16]);
            f.TorrentQueueOrder     = Int32.Parse(file[17]);
            f.Remaining             = double.Parse(file[18]);

            if (file.Length > 19)
            {
                try
                {
                    f.TorrentSource = file[19];
                    f.RssFeed = file[20];
                    f.StatusString = file[21];
                }
                catch
                {
                    f.TorrentSource = "";
                    f.RssFeed = "";
                    f.StatusString = "";
                }
            }

            return f;
        }
예제 #4
0
        public static TorrentFile ConvertStringArray(string[] file)
        {
            TorrentFile torrentFile = new TorrentFile();

            torrentFile.Hash                  = file[0];
            torrentFile.Status                = Int32.Parse(file[1], CultureInfo.CurrentCulture);
            torrentFile.Name                  = file[2];
            torrentFile.Size                  = double.Parse(file[3], CultureInfo.CurrentCulture);
            torrentFile.PercentProgress       = Int32.Parse(file[4], CultureInfo.CurrentCulture);
            torrentFile.Downloaded            = double.Parse(file[5], CultureInfo.CurrentCulture);
            torrentFile.Uploaded              = double.Parse(file[6], CultureInfo.CurrentCulture);
            torrentFile.Ratio                 = Int32.Parse(file[7], CultureInfo.CurrentCulture);
            torrentFile.UploadSpeed           = Int32.Parse(file[8], CultureInfo.CurrentCulture);
            torrentFile.DownloadSpeed         = Int32.Parse(file[9], CultureInfo.CurrentCulture);
            torrentFile.Eta                   = Int32.Parse(file[10], CultureInfo.CurrentCulture);
            torrentFile.Label                 = file[11];
            torrentFile.PeersConnected        = Int32.Parse(file[12], CultureInfo.CurrentCulture);
            torrentFile.PeersInSwarm          = Int32.Parse(file[13], CultureInfo.CurrentCulture);
            torrentFile.SeedsConnected        = Int32.Parse(file[14], CultureInfo.CurrentCulture);
            torrentFile.SeedsInSwarm          = Int32.Parse(file[15], CultureInfo.CurrentCulture);
            torrentFile.Availability          = double.Parse(file[16], CultureInfo.CurrentCulture);
            torrentFile.TorrentQueueOrder     = Int32.Parse(file[17], CultureInfo.CurrentCulture);
            torrentFile.Remaining             = double.Parse(file[18], CultureInfo.CurrentCulture);
            torrentFile.TorrentSource         = "";
            torrentFile.RssFeed               = "";
            torrentFile.StatusString          = "";

            if (file.Length > 19)
            {
                torrentFile.TorrentSource = file[19];
                torrentFile.RssFeed = file[20];
                torrentFile.StatusString = file[21];
            }

            return torrentFile;
        }