Archived
1
0

[Hotfix] Updated VideoCard.xaml.cs

This commit is contained in:
Michael Gordeev
2019-07-11 20:25:29 +00:00
parent ac0262b47e
commit 3eeb6ea762
+15 -3
View File
@@ -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;