Exemple #1
0
        public IQueryable <TorrentLink> Torrents(SerieLink serie)
        {
            var stats = new RavenQueryStatistics();
            var query = this.Session.Query <TorrentLink>()
                        .Statistics(out stats)
                        .Where(t => t.SerieLinkId == serie.Id);
            var results = query.ToList();

            results.AddRange(query.Skip(results.Count).Take(stats.TotalResults - results.Count));
            return(results.AsQueryable());
        }
Exemple #2
0
        private SerieLink DecodeElement(HtmlNode option)
        {
            var    serie = new SerieLink();
            string url   = option.Attributes["value"].Value;

            serie.Url   = MakeUri(url).AbsoluteUri;
            serie.Title = String.IsNullOrWhiteSpace(option.InnerText) ? url : option.InnerText;
            string id = url.Split('_').Last().Split('.').First();

            serie.Id = "OMG_" + id;
            return(serie);
        }
Exemple #3
0
        public IEnumerable <TorrentLink> GetTorrents(SerieLink serie)
        {
            List <TorrentLink> torrents = new List <TorrentLink>();
            OmgTorrentCrawler  crawler  = new OmgTorrentCrawler();
            var task = crawler.CollectSerieTorrents(serie.Url);

            task.ConfigureAwait(false);
            var results = task.Result;

            if (results != null)
            {
                foreach (var torrent in results)
                {
                    torrent.SerieLinkId = serie.Id;
                }
                torrents.AddRange(results);
            }
            return(torrents);
        }
Exemple #4
0
 public void Add(SerieLink serie)
 {
     this.Session.Store(serie);
 }