From 3eeb6ea762c8e120eda83cc5cb6fe9ec01d3af45 Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Thu, 11 Jul 2019 20:25:29 +0000 Subject: [PATCH] [Hotfix] Updated VideoCard.xaml.cs --- FoxTube/Controls/VideoCard.xaml.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/FoxTube/Controls/VideoCard.xaml.cs b/FoxTube/Controls/VideoCard.xaml.cs index a47ef55..fa3e4e1 100644 --- a/FoxTube/Controls/VideoCard.xaml.cs +++ b/FoxTube/Controls/VideoCard.xaml.cs @@ -99,10 +99,14 @@ namespace FoxTube.Controls } LoadAddTo(); + var channelRequest = SecretsVault.Service.Channels.List("snippet"); + channelRequest.Id = item.Snippet.ChannelId; + try { thumbnail.Source = new BitmapImage(item.Snippet.Thumbnails.Medium.Url.ToUri()); - avatar.ProfilePicture = new BitmapImage((await new YoutubeClient().GetChannelAsync(item.Snippet.ChannelId)).LogoUrl.ToUri()) { DecodePixelWidth = 46, DecodePixelHeight = 46 }; + avatar.ProfilePicture = new BitmapImage((await channelRequest.ExecuteAsync()).Items[0].Snippet.Thumbnails.Medium.Url.ToUri()) { DecodePixelHeight = 46, DecodePixelWidth = 46 }; + //avatar.ProfilePicture = new BitmapImage((await new YoutubeClient().GetChannelAsync(item.Snippet.ChannelId)).LogoUrl.ToUri()) { DecodePixelWidth = 46, DecodePixelHeight = 46 }; } catch { } @@ -208,8 +212,16 @@ namespace FoxTube.Controls info.Text = $"{item.ContentDetails.Duration.GetDuration()} | {Methods.GetAgo(item.Snippet.PublishedAt.Value)}"; } - thumbnail.Source = new BitmapImage(item.Snippet.Thumbnails.Medium.Url.ToUri()); - avatar.ProfilePicture = new BitmapImage((await new YoutubeClient().GetChannelAsync(item.Snippet.ChannelId)).LogoUrl.ToUri()) { DecodePixelHeight = 50, DecodePixelWidth = 50 }; + var channelRequest = SecretsVault.Service.Channels.List("snippet"); + channelRequest.Id = item.Snippet.ChannelId; + + try + { + thumbnail.Source = new BitmapImage(item.Snippet.Thumbnails.Medium.Url.ToUri()); + avatar.ProfilePicture = new BitmapImage((await channelRequest.ExecuteAsync()).Items[0].Snippet.Thumbnails.Medium.Url.ToUri()) { DecodePixelHeight = 46, DecodePixelWidth = 46 }; + //avatar.ProfilePicture = new BitmapImage((await new YoutubeClient().GetChannelAsync(item.Snippet.ChannelId)).LogoUrl.ToUri()) { DecodePixelWidth = 46, DecodePixelHeight = 46 }; + } + catch { } if (SecretsVault.History.Contains(item.Id)) watched.Visibility = Visibility.Visible;