protected override VirtualHierarchy CreateHierarchy() { var hierarchy = new VirtualHierarchy(ID); new RssFeed("http://channel9.msdn.com/Feeds/RSS/", _downloader).AddToHierarchy(hierarchy); new Shows("http://channel9.msdn.com/Browse/Shows?sort=atoz&page=1", _downloader).AddToHierarchy(hierarchy); new Tags("http://channel9.msdn.com/Browse/Tags?page=1", _downloader).AddToHierarchy(hierarchy); new Series("http://channel9.msdn.com/Browse/Series?sort=atoz&page=1", _downloader).AddToHierarchy(hierarchy); return hierarchy; }
public Payload GetSharedMedia(string id, bool includeChildren, int startIndex, int requestCount) { _hierarchy = _hierarchy ?? CreateHierarchy(); var node = _hierarchy.GetNode(id); IEnumerable<AbstractSharedMediaInfo> nodes = new []{node.ToMedia()}; if (includeChildren) { nodes = _hierarchy.GetChildren(node).Select(n => n.ToMedia()) .Skip(startIndex); if (requestCount != 0) { nodes = nodes.Take(requestCount); } } var list = nodes.ToArray(); ApplySortIndexes(list); return new Payload(node.Id, node.ParentId, node.Title, 0, list, node.IsContainer); }
public void AddToHierarchy(VirtualHierarchy hierarchy) { hierarchy.AddFolder(hierarchy.Root, "Shows", folderSource: new ShowsFolderSource( new FolderStructure("div", "entry-meta", "title"), _url, _downloader)); }
public void AddToHierarchy(VirtualHierarchy hierarchy) { hierarchy.AddFolder(hierarchy.Root, "Tags", folderSource: new ShowsFolderSource( new FolderStructure("ul", "default", ""), _url, _downloader)); }
public IEnumerable<HierarchyNode> GetChildren(VirtualHierarchy virtualHierarchy) { foreach (var hierarchyNode in _children) { yield return hierarchyNode; } if (_folderSource != null) { foreach (var node in _folderSource.FolderItems() .Select(fi => virtualHierarchy.CreateFolder(this, fi.Name, mediaSource: fi, folderSource: fi))) { yield return node; } } if (_mediaSource != null) { foreach (var node in _mediaSource.MediaItems().Select(mi => virtualHierarchy.CreateMediaItemNode(this, mi))) { yield return node; } } }