Esempio n. 1
0
 public XenoPlaylist(string name, string channelId, IXenoPlaylist parent)
 {
     this.Name           = name;
     this.ChannelId      = channelId;
     this.ParentPlaylist = parent;
     parent.ChildPlaylists.Add(this);
 }
        /// <summary>
        /// Xenoのプレイリストをアプリケーション側で使えるデータに変換する
        /// </summary>
        /// <param name="playlist"></param>
        /// <param name="recurse"></param>
        /// <returns></returns>
        public ITreePlaylistInfo ConvertToTreePlaylistInfo(IXenoPlaylist playlist, bool recurse = true)
        {
            var converted = new NonBindableTreePlaylistInfo()
            {
                Name             = new ReactiveProperty <string>(playlist.Name),
                IsRemotePlaylist = playlist.IsChannel,
                RemoteType       = playlist.IsChannel ? RemoteType.Channel : RemoteType.None,
                RemoteId         = playlist.ChannelId ?? string.Empty,
            };

            converted.Videos.AddRange(playlist.Videos.Select(v => {
                var video = this.videoInfoContainer.GetVideo(v);
                return(video);
            }));

            if (playlist.ChildPlaylists.Count > 0 && recurse)
            {
                converted.Children.Addrange(playlist.ChildPlaylists.Select(c => this.ConvertToTreePlaylistInfo(c, true)));
            }

            return(converted);
        }
Esempio n. 3
0
 public XenoPlaylist(string name, IXenoPlaylist parent)
 {
     this.Name           = name;
     this.ParentPlaylist = parent;
     parent.ChildPlaylists.Add(this);
 }
Esempio n. 4
0
 public XenoParseResult(IXenoPlaylist root)
 {
     this.RootPlaylist = root;
 }