public static string ItemTopictypeToDescription(NicoRepoItemTopic topicType, NicoRepoTimelineItem timelineItem) { switch (topicType) { case NicoRepoItemTopic.Unknown: return($"(対応していないニコレポアイテム)"); case NicoRepoItemTopic.NicoVideo_User_Video_Kiriban_Play: return($"動画再生数がキリ番に到達しました"); case NicoRepoItemTopic.NicoVideo_User_Video_Upload: return($"{timelineItem.SenderNiconicoUser.Nickname} さんが動画を投稿"); case NicoRepoItemTopic.NicoVideo_Community_Level_Raise: return($"コミュニティレベル"); case NicoRepoItemTopic.NicoVideo_User_Mylist_Add_Video: return($"{timelineItem.SenderNiconicoUser.Nickname} さんがマイリストに動画を追加"); case NicoRepoItemTopic.NicoVideo_User_Community_Video_Add: return($"コミュニティ動画に動画が追加されました"); case NicoRepoItemTopic.NicoVideo_User_Video_UpdateHighestRankings: return($"動画がランキングにランクイン"); case NicoRepoItemTopic.NicoVideo_User_Video_Advertise: return($"動画が広告されました"); case NicoRepoItemTopic.NicoVideo_Channel_Blomaga_Upload: return($"ブロマガが投稿されました"); case NicoRepoItemTopic.NicoVideo_Channel_Video_Upload: return($"{timelineItem.SenderChannel.Name} が動画を投稿"); case NicoRepoItemTopic.Live_User_Program_OnAirs: return($"{timelineItem.SenderNiconicoUser.Nickname} さんが生放送を開始"); case NicoRepoItemTopic.Live_User_Program_Reserve: return($"{timelineItem.SenderNiconicoUser.Nickname} さんが生放送を予約"); case NicoRepoItemTopic.Live_Channel_Program_Onairs: return($"{timelineItem.SenderChannel.Name} が生放送を開始"); case NicoRepoItemTopic.Live_Channel_Program_Reserve: return($"{timelineItem.SenderChannel.Name} が生放送を予約"); default: return(string.Empty); } }
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; * } */ }
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); }
public static NicoRepoItemTopic ToNicoRepoTopicType(string topic) { NicoRepoItemTopic topicType = NicoRepoItemTopic.Unknown; switch (topic) { case "live.user.program.onairs": topicType = NicoRepoItemTopic.Live_User_Program_OnAirs; break; case "live.user.program.reserve": topicType = NicoRepoItemTopic.Live_User_Program_Reserve; break; case "nicovideo.user.video.kiriban.play": topicType = NicoRepoItemTopic.NicoVideo_User_Video_Kiriban_Play; break; case "nicovideo.user.video.upload": topicType = NicoRepoItemTopic.NicoVideo_User_Video_Upload; break; case "nicovideo.community.level.raise": topicType = NicoRepoItemTopic.NicoVideo_Community_Level_Raise; break; case "nicovideo.user.mylist.add.video": topicType = NicoRepoItemTopic.NicoVideo_User_Mylist_Add_Video; break; case "nicovideo.user.community.video.add": topicType = NicoRepoItemTopic.NicoVideo_User_Community_Video_Add; break; case "nicovideo.user.video.update_highest_rankings": topicType = NicoRepoItemTopic.NicoVideo_User_Video_UpdateHighestRankings; break; case "nicovideo.user.video.advertise": topicType = NicoRepoItemTopic.NicoVideo_User_Video_Advertise; break; case "nicovideo.channel.blomaga.upload": topicType = NicoRepoItemTopic.NicoVideo_Channel_Blomaga_Upload; break; case "nicovideo.channel.video.upload": topicType = NicoRepoItemTopic.NicoVideo_Channel_Video_Upload; break; case "live.channel.program.onairs": topicType = NicoRepoItemTopic.Live_Channel_Program_Onairs; break; case "live.channel.program.reserve": topicType = NicoRepoItemTopic.Live_Channel_Program_Reserve; break; default: break; } return(topicType); }
public NicoRepoLiveTimeline(NicoRepoTimelineItem timelineItem, NicoRepoItemTopic itemType, HohoemaPlaylist playlist) : base(timelineItem, itemType, playlist) { }
public NicoRepoTimelineVM(NicoRepoTimelineItem timelineItem, NicoRepoItemTopic itemType, HohoemaPlaylist playlist) { TimelineItem = timelineItem; HohoemaPlaylist = playlist; ItemTopic = itemType; if (TimelineItem.Program != null) { this.Label = TimelineItem.Program.Title; AddImageUrl(TimelineItem.Program.ThumbnailUrl); this.OptionText = $"{TimelineItem.Program.BeginAt.ToString()} 放送開始"; if (TimelineItem.Community != null) { _OwnerUserId = TimelineItem.Community.Id; OwnerUserName = TimelineItem.Community.Name; } else { _OwnerUserId = TimelineItem.SenderChannel.Id.ToString(); OwnerUserName = TimelineItem.SenderChannel.Name; OwnerUserType = UserType.User; } } else 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()}"; } if (TimelineItem.SenderNiconicoUser != null) { _OwnerUserId = TimelineItem.SenderNiconicoUser.Id.ToString(); OwnerUserName = TimelineItem.SenderNiconicoUser.Nickname; OwnerUserType = UserType.User; } if (TimelineItem.SenderNiconicoUser != null) { this.Description = this.TimelineItem.SenderNiconicoUser.Nickname; } else if (TimelineItem.SenderChannel != null) { this.Description = this.TimelineItem.SenderChannel.Name; OwnerUserType = UserType.Channel; } switch (ItemTopic) { case NicoRepoItemTopic.Unknown: Description = $"(対応していないニコレポアイテム)"; break; case NicoRepoItemTopic.NicoVideo_User_Video_Kiriban_Play: Description = $"動画再生数がキリ番に到達しました"; break; case NicoRepoItemTopic.NicoVideo_User_Video_Upload: Description = $"{this.TimelineItem.SenderNiconicoUser.Nickname} さんが動画を投稿"; break; case NicoRepoItemTopic.NicoVideo_Community_Level_Raise: Description = $"コミュニティレベル"; break; case NicoRepoItemTopic.NicoVideo_User_Mylist_Add_Video: Description = $"{this.TimelineItem.SenderNiconicoUser.Nickname} さんがマイリストに動画を追加"; break; case NicoRepoItemTopic.NicoVideo_User_Community_Video_Add: Description = $"コミュニティ動画に動画が追加されました"; break; case NicoRepoItemTopic.NicoVideo_User_Video_UpdateHighestRankings: Description = $"動画がランキングにランクイン"; break; case NicoRepoItemTopic.NicoVideo_User_Video_Advertise: Description = $"動画が広告されました"; break; case NicoRepoItemTopic.NicoVideo_Channel_Blomaga_Upload: Description = $"ブロマガが投稿されました"; break; case NicoRepoItemTopic.NicoVideo_Channel_Video_Upload: Description = $"{this.TimelineItem.SenderChannel.Name} が動画を投稿"; break; case NicoRepoItemTopic.Live_User_Program_OnAirs: Description = $"{this.TimelineItem.SenderNiconicoUser.Nickname} さんが生放送を開始"; break; case NicoRepoItemTopic.Live_User_Program_Reserve: Description = $"{this.TimelineItem.SenderNiconicoUser.Nickname} さんが生放送を予約"; break; case NicoRepoItemTopic.Live_Channel_Program_Onairs: Description = $"{this.TimelineItem.SenderChannel.Name} が生放送を開始"; break; case NicoRepoItemTopic.Live_Channel_Program_Reserve: Description = $"{this.TimelineItem.SenderChannel.Name} が生放送を予約"; break; default: break; } }