Exemplo n.º 1
0
        public List <Models.FileEntry> getTorrentFiles(string hash)
        {
            List <Models.FileEntry> feList = new List <Models.FileEntry>();

            Models.FileEntry   fe;
            Core.TorrentHandle th = getTorrentHandle(hash);
            using (Core.TorrentInfo ti = th.torrent_file())
            {
                if (ti == null)
                {
                    // non ci sono file nel torrent
                    fe          = new Models.FileEntry();
                    fe.FileName = th.ToString();
                    feList.Add(fe);
                }
                else
                {
                    for (int i = 0; i <= ti.num_files() - 1; i++)
                    {
                        fe           = new Models.FileEntry(ti.files().at(i));
                        fe.FileName  = ti.files().file_name(i);
                        fe.IsValid   = ti.files().is_valid();
                        fe.PieceSize = ti.piece_size(i);
                        //ti.files().name(); ???
                        //ti.trackers();
                        feList.Add(fe);
                    }
                }
            }
            //Core.TorrentHandle th = getTorrentHandle(hash);
            //Core.TorrentInfo ti = th.torrent_file();
            return(feList);
        }
Exemplo n.º 2
0
        public static List <Models.FileEntry> getTorrentFiles(string hash)
        {
            List <Models.FileEntry> feList = new List <Models.FileEntry>();

            Models.FileEntry fe;

            Core.TorrentHandle th = getTorrentHandle(hash);
            Core.TorrentInfo   ti = th.torrent_file();
            for (int i = 0; i <= ti.num_files() - 1; i++)
            {
                fe           = new Models.FileEntry(ti.files().at(i));
                fe.FileName  = ti.files().file_name(i);
                fe.IsValid   = ti.files().is_valid();
                fe.PieceSize = ti.piece_size(i);
                //ti.files().name(); ???
                //ti.trackers();
                feList.Add(fe);
            }
            return(feList);
        }
Exemplo n.º 3
0
        public static List<Models.FileEntry> getTorrentFiles(string hash)
        {
            List<Models.FileEntry> feList = new List<Models.FileEntry>();
            Models.FileEntry fe;

            Core.TorrentHandle th = getTorrentHandle(hash);
            Core.TorrentInfo ti = th.torrent_file();
            for (int i = 0; i <= ti.num_files() - 1; i++)
            {
                fe = new Models.FileEntry(ti.files().at(i));
                fe.FileName = ti.files().file_name(i);
                fe.IsValid = ti.files().is_valid();
                fe.PieceSize = ti.piece_size(i);
                //ti.files().name(); ???
                //ti.trackers();
                feList.Add(fe);
            }
            return feList;
        }