private void OnActivityReceive(ChannelActivityEvent activityEvent)
        {
            StoredChannel   channel = Channels.First(c => c.ChannelId == activityEvent.ChannelId);
            YoutubeActivity latest  = activityEvent.Result.items.OrderByDescending(act => act.Snippet.PublishedAt).First();

            channel.NewVideo           = channel.LastVideoId == null || !channel.LastVideoId.Equals(latest.VideoId);
            channel.LastVideoId        = latest.VideoId;
            channel.LastVideoImageLink = latest.ImageLink;
            channel.LastVideoTitle     = latest.Snippet.Title;
            channel.LastVideoTime      = latest.Snippet.PublishedAt.ToShortDateString() + " " + latest.Snippet.PublishedAt.ToShortTimeString();
            channel.Activity           = latest;
            channel.Searching          = false;
            App.ChannelsDatastore.AddUpdate(channel);
        }
Exemplo n.º 2
0
 public static YoutubeActivity RequestAllParts(this YoutubeActivity activity)
 {
     return(activity.RequestSnippet().RequestContentDetails());
 }
Exemplo n.º 3
0
 public static YoutubeActivity RequestSnippet(this YoutubeActivity activity)
 {
     return(activity.RequestPart(PartType.Snippet));
 }
Exemplo n.º 4
0
 public static YoutubeActivity RequestContentDetails(this YoutubeActivity activity)
 {
     return(activity.RequestPart(PartType.ContentDetails));
 }
Exemplo n.º 5
0
 public static YoutubeActivity RequestPart(this YoutubeActivity activity, PartType partType)
 {
     return(Activity(activity.Settings.Clone(), activity.PartTypes.Append(partType).ToArray()));
 }