コード例 #1
0
        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;
        }
コード例 #2
0
ファイル: ProviderBase.cs プロジェクト: ArildF/Playon-Plugins
        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);
        }
コード例 #3
0
ファイル: Shows.cs プロジェクト: ArildF/Playon-Plugins
 public void AddToHierarchy(VirtualHierarchy hierarchy)
 {
     hierarchy.AddFolder(hierarchy.Root, "Shows", folderSource: new ShowsFolderSource(
         new FolderStructure("div", "entry-meta", "title"), _url, _downloader));
 }
コード例 #4
0
ファイル: Tags.cs プロジェクト: ArildF/Playon-Plugins
 public void AddToHierarchy(VirtualHierarchy hierarchy)
 {
     hierarchy.AddFolder(hierarchy.Root, "Tags", folderSource: new ShowsFolderSource(
                                                     new FolderStructure("ul", "default", ""), _url,
                                                     _downloader));
 }
コード例 #5
0
            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;
                    }
                }
            }