Archived
1
0

Improving thumbnails quality

This commit is contained in:
Michael Gordeev
2018-12-30 12:44:39 +03:00
parent f927d77cd3
commit f797b4f851
3 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ namespace FoxTube.Controls
{ {
if (item.BrandingSettings.Image.BannerImageUrl.Contains("default")) if (item.BrandingSettings.Image.BannerImageUrl.Contains("default"))
throw new Exception("Default channel cover detected"); throw new Exception("Default channel cover detected");
cover.Source = new BitmapImage(new Uri(item.BrandingSettings.Image.BannerTvLowImageUrl)); cover.Source = new BitmapImage((item.BrandingSettings.Image.BannerTvHighImageUrl ?? item.BrandingSettings.Image.BannerTvImageUrl).ToUri());
} }
catch { } catch { }
} }
+1 -1
View File
@@ -40,7 +40,7 @@ namespace FoxTube.Controls
try try
{ {
thumbnail.Source = new BitmapImage(new Uri(item.Snippet.Thumbnails.Medium.Url)); thumbnail.Source = new BitmapImage((item.Snippet.Thumbnails.Maxres ?? item.Snippet.Thumbnails.Medium).Url.ToUri());
avatar.ProfilePicture = new BitmapImage(new Uri((await r.ExecuteAsync()).Items[0].Snippet.Thumbnails.Medium.Url)); avatar.ProfilePicture = new BitmapImage(new Uri((await r.ExecuteAsync()).Items[0].Snippet.Thumbnails.Medium.Url));
} catch { } } catch { }
} }
+5 -2
View File
@@ -65,7 +65,10 @@ namespace FoxTube.Controls
else else
{ {
views.Text = $"{item.Statistics.ViewCount:0,0} views"; views.Text = $"{item.Statistics.ViewCount:0,0} views";
info.Text = $"{XmlConvert.ToTimeSpan(item.ContentDetails.Duration)} | {Methods.GetAgo(item.Snippet.PublishedAt.Value)}"; string dur = string.Empty;
try { XmlConvert.ToTimeSpan(item.ContentDetails.Duration); }
catch { }
info.Text = $"{dur} | {Methods.GetAgo(item.Snippet.PublishedAt.Value)}";
embed = false; embed = false;
} }
@@ -76,7 +79,7 @@ namespace FoxTube.Controls
try try
{ {
avatar.ProfilePicture = new BitmapImage(new Uri(response1.Items[0].Snippet.Thumbnails.Medium.Url)); avatar.ProfilePicture = new BitmapImage(new Uri(response1.Items[0].Snippet.Thumbnails.Medium.Url));
thumbnail.Source = new BitmapImage(new Uri(item.Snippet.Thumbnails.Medium.Url)); thumbnail.Source = new BitmapImage(new Uri((item.Snippet.Thumbnails.Maxres ?? item.Snippet.Thumbnails.Medium).Url));
} }
catch { } catch { }