Exemplo n.º 1
0
        public NicoRepoVideoTimeline(NicoRepoTimelineItem timelineItem, NicoRepoItemTopic itemType)
            : base(timelineItem.Video.Id)
        {
            TimelineItem = timelineItem;
            ItemTopic    = itemType;

            if (TimelineItem.Video != null)
            {
                this.Label = TimelineItem.Video.Title;
                if (TimelineItem.Video.ThumbnailUrl.Small != null)
                {
                    AddImageUrl(TimelineItem.Video.ThumbnailUrl.Small);
                }
                else if (TimelineItem.Video.ThumbnailUrl.Normal != null)
                {
                    AddImageUrl(TimelineItem.Video.ThumbnailUrl.Normal);
                }
                this.OptionText = $"{TimelineItem.CreatedAt.ToString()}";
            }

            Description = NicoRepoTimelineVM.ItemTopictypeToDescription(ItemTopic, TimelineItem);

            /*
             *
             * if (TimelineItem.SenderNiconicoUser != null)
             * {
             *  ProviderId = TimelineItem.SenderNiconicoUser.Id.ToString();
             *  ProviderName = TimelineItem.SenderNiconicoUser.Nickname;
             *  ProviderType = UserType.User;
             * }
             *
             *
             * if (TimelineItem.SenderNiconicoUser != null)
             * {
             *  this.Description = this.TimelineItem.SenderNiconicoUser.Nickname;
             * }
             * else if (TimelineItem.SenderChannel != null)
             * {
             *  this.Description = this.TimelineItem.SenderChannel.Name;
             *  _OwnerUserId = TimelineItem.SenderChannel.Id.ToString();
             *  ProviderType = UserType.Channel;
             * }
             */
        }
Exemplo n.º 2
0
        public NicoRepoLiveTimeline(NicoRepoTimelineItem timelineItem, NicoRepoItemTopic itemTopic)
            : base(timelineItem.Program.Id)
        {
            TimelineItem = timelineItem;
            ItemTopic    = itemTopic;
            if (TimelineItem.Program != null)
            {
                this.Label = TimelineItem.Program.Title;
                AddImageUrl(TimelineItem.Program.ThumbnailUrl);
                this.OptionText = $"{TimelineItem.Program.BeginAt.ToString()} 放送開始";

                if (TimelineItem.Community != null)
                {
                    CommunityGlobalId = TimelineItem.Community.Id;
                    CommunityName     = TimelineItem.Community.Name;
                }
                else
                {
                    CommunityGlobalId = TimelineItem.SenderChannel.Id.ToString();
                    CommunityName     = TimelineItem.SenderChannel.Name;
                }
            }

            if (timelineItem.SenderChannel != null)
            {
                this.CommunityType = CommunityType.Channel;
            }
            else if (timelineItem.Community != null)
            {
                this.CommunityType = CommunityType.Community;
            }
            else
            {
                this.CommunityType = CommunityType.Official;
            }

            Description = NicoRepoTimelineVM.ItemTopictypeToDescription(ItemTopic, TimelineItem);
        }