Exemplo n.º 1
0
        public MChannel(Channel channel)
        {
            if (channel == null)
            {
                return;
            }

            Id = channel.Id;
            if (channel.BrandingSettings != null)
            {
                if (channel.BrandingSettings.Image != null)
                {
                    Image = channel.BrandingSettings.Image.BannerMobileImageUrl;
                }
            }

            Thumbnails = new MThumbnailDetails();
            Statistics = new MChannelStatistics();

            if (channel.Snippet == null)
            {
                return;
            }

            Title       = channel.Snippet.Title;
            Description = channel.Snippet.Description;
            Thumbnails  = new MThumbnailDetails(channel.Snippet.Thumbnails);
            Statistics  = new MChannelStatistics(channel.Statistics);
        }
Exemplo n.º 2
0
 public MPlaylistItemSnippet(PlaylistItemSnippet playlistItemSnippet)
 {
     if (playlistItemSnippet != null)
     {
         ChannelId      = playlistItemSnippet.ChannelId;
         ChannelTitle   = playlistItemSnippet.ChannelTitle;
         Description    = playlistItemSnippet.Description;                PlaylistId = playlistItemSnippet.PlaylistId;
         Position       = playlistItemSnippet.Position;
         PublishedAt    = playlistItemSnippet.PublishedAt;
         PublishedAtRaw = playlistItemSnippet.PublishedAtRaw;
         ResourceId     = new MResourceId(playlistItemSnippet.ResourceId);
         Thumbnails     = new MThumbnailDetails(playlistItemSnippet.Thumbnails);
         Title          = playlistItemSnippet.Title;
         return;
     }
     ResourceId     = MResourceId.Empty;
     Thumbnails     = MThumbnailDetails.Empty;
     ChannelId      = playlistItemSnippet.ChannelId;
     ChannelTitle   = playlistItemSnippet.ChannelTitle;
     Description    = playlistItemSnippet.Description;
     PlaylistId     = playlistItemSnippet.PlaylistId;
     Position       = playlistItemSnippet.Position;
     PublishedAt    = playlistItemSnippet.PublishedAt;
     PublishedAtRaw = playlistItemSnippet.PublishedAtRaw;
     ResourceId     = new MResourceId(playlistItemSnippet.ResourceId);
     Thumbnails     = new MThumbnailDetails(playlistItemSnippet.Thumbnails);
     Title          = playlistItemSnippet.Title;
 }
Exemplo n.º 3
0
 public MPlaylistSnippet()
 {
     Thumbnails      = new MThumbnailDetails();
     Localized       = new MPlaylistLocalization();
     ChannelId       = string.Empty;
     ChannelTitle    = string.Empty;
     DefaultLanguage = string.Empty;
     Description     = string.Empty;
     PublishedAt     = DateTime.MinValue;
     PublishedAtRaw  = string.Empty;
     Tags            = new List <string>();
     Title           = string.Empty;
 }
Exemplo n.º 4
0
        public MVideoItem(SearchResult item, IVideoDetails details)
        {
            Details = details;
            if (item.Snippet == null)
            {
                return;
            }

            ChannelId      = item.Snippet.ChannelId;
            ChannelTitle   = item.Snippet.ChannelTitle;
            Thumbnails     = new MThumbnailDetails(item.Snippet.Thumbnails);
            PublishedAt    = item.Snippet.PublishedAt;
            PublishedAtRaw = item.Snippet.PublishedAtRaw;
            Kind           = item.Kind;
        }
Exemplo n.º 5
0
        public MPlaylistSnippet(PlaylistSnippet snippet) : this()
        {
            if (snippet == null)
            {
                return;
            }

            ChannelId       = snippet.ChannelId;
            ChannelTitle    = snippet.ChannelTitle;
            DefaultLanguage = snippet.DefaultLanguage;
            Description     = snippet.Description;
            Localized       = new MPlaylistLocalization(snippet.Localized);
            PublishedAt     = snippet.PublishedAt;
            PublishedAtRaw  = snippet.PublishedAtRaw;
            Tags            = snippet.Tags;
            Thumbnails      = new MThumbnailDetails(snippet.Thumbnails);
            Title           = snippet.Title;
        }
        public MSubscription(Subscription subscription)
        {
            var snippet = subscription.Snippet;

            if (snippet == null)
            {
                return;
            }

            if (snippet.ResourceId != null)
            {
                ChannelId = snippet.ResourceId.ChannelId;
            }

            Title       = snippet.Title;
            Description = snippet.Description;
            Thumbnails  = new MThumbnailDetails(snippet.Thumbnails);
        }
Exemplo n.º 7
0
        public MVideoItem(Video video)
        {
            if (video == null)
            {
                return;
            }

            if (video.Snippet == null)
            {
                return;
            }

            ChannelId      = video.Snippet.ChannelId;
            ChannelTitle   = video.Snippet.ChannelTitle;
            Thumbnails     = new MThumbnailDetails(video.Snippet.Thumbnails);
            PublishedAt    = video.Snippet.PublishedAt;
            PublishedAtRaw = video.Snippet.PublishedAtRaw;
            Details        = new MVideoDetails(video);
            Kind           = video.Kind;
        }
Exemplo n.º 8
0
        public MChannel(SearchResult channel)
        {
            if (channel == null)
            {
                return;
            }

            if (channel.Id != null)
            {
                Id = channel.Id.ChannelId;
            }

            Thumbnails = new MThumbnailDetails();
            Statistics = new MChannelStatistics();

            if (channel.Snippet == null)
            {
                return;
            }

            Title       = channel.Snippet.Title;
            Description = channel.Snippet.Description;
            Thumbnails  = new MThumbnailDetails(channel.Snippet.Thumbnails);
        }