diff --git a/FoxTube/Classes/SearchPaameters.cs b/FoxTube/Classes/SearchPaameters.cs
index 8b6e86c..323cb70 100644
--- a/FoxTube/Classes/SearchPaameters.cs
+++ b/FoxTube/Classes/SearchPaameters.cs
@@ -129,5 +129,21 @@ namespace FoxTube
Channel = channelId;
Filter = filters;
}
+
+ public override string ToString()
+ {
+ return $@"Term: {Term}
+Channel id: {Channel}
+Filters:
+ Order: {Filter.Order}
+ Type: {Filter.Type}
+ Date: {Filter.Date}
+ Duration: {Filter.Duration}
+ HD: {Filter.HD}
+ 3D: {Filter.Is3D}
+ Event type: {Filter.LiveEvent}
+ CC: {Filter.Captions}
+ License: {Filter.CreativeCommons}";
+ }
}
}
diff --git a/FoxTube/Classes/SecretsVault.cs b/FoxTube/Classes/SecretsVault.cs
index a35c667..9469c84 100644
--- a/FoxTube/Classes/SecretsVault.cs
+++ b/FoxTube/Classes/SecretsVault.cs
@@ -141,8 +141,12 @@ namespace FoxTube
#endregion
#region Retrieving user's data
- WatchLater = await Methods.GetLater();
- History = await Methods.GetHistory();
+ try
+ {
+ WatchLater = await Methods.GetLater();
+ History = await Methods.GetHistory();
+ }
+ catch { }
var request = Service.Channels.List("snippet,contentDetails");
request.Mine = true;
diff --git a/FoxTube/Pages/ChannelPage.xaml b/FoxTube/Pages/ChannelPage.xaml
index a3c4710..557667d 100644
--- a/FoxTube/Pages/ChannelPage.xaml
+++ b/FoxTube/Pages/ChannelPage.xaml
@@ -8,6 +8,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pages="using:FoxTube.Pages"
xmlns:controls="using:FoxTube.Controls"
+ xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
mc:Ignorable="d">
@@ -19,8 +20,10 @@
-
-
+
+
+
+
@@ -63,46 +66,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/FoxTube/Pages/ChannelPage.xaml.cs b/FoxTube/Pages/ChannelPage.xaml.cs
index d8d7311..28d3d1e 100644
--- a/FoxTube/Pages/ChannelPage.xaml.cs
+++ b/FoxTube/Pages/ChannelPage.xaml.cs
@@ -44,10 +44,10 @@ namespace FoxTube.Pages
loading = grid.Children[2] as LoadingPage;
playlistLoading = playlists.Children[1] as LoadingPage;
- videoList = videos.Children[2] as VideoGrid;
+ videoList = videos.Children[1] as VideoGrid;
playlistList = (playlists.Children[0] as StackPanel).Children[1] as VideoGrid;
- videoMore = videos.Children[3] as ShowMore;
+ videoMore = videos.Children[2] as ShowMore;
playlistMore = (playlists.Children[0] as StackPanel).Children[2] as ShowMore;
loading.RefreshPage += Refresh_Click;
@@ -88,15 +88,13 @@ namespace FoxTube.Pages
{
if (item.BrandingSettings.Image.BannerImageUrl.Contains("default"))
throw new Exception("Default channel cover detected");
- channelCover.Source = new BitmapImage(new Uri(item.BrandingSettings.Image.BannerImageUrl));
+ channelCover.ImageSource = new BitmapImage(new Uri(item.BrandingSettings.Image.BannerImageUrl));
}
catch { }
try { avatar.ProfilePicture = new BitmapImage(new Uri(item.Snippet.Thumbnails.Medium.Url)); }
catch { }
Methods.FormatText(ref description, item.Snippet.Description);
- views.Text = $"{item.Statistics.ViewCount:0,0}";
- registration.Text = item.Snippet.PublishedAt.ToString();
videoRequest = SecretsVault.Service.Search.List("id");
videoRequest.ChannelId = id;
diff --git a/FoxTube/Pages/MainPage.xaml.cs b/FoxTube/Pages/MainPage.xaml.cs
index ddb6d79..5fb35d4 100644
--- a/FoxTube/Pages/MainPage.xaml.cs
+++ b/FoxTube/Pages/MainPage.xaml.cs
@@ -328,7 +328,8 @@ namespace FoxTube
if ((videoPlaceholder.Content as VideoPage).loading.State != LoadingState.Loaded)
CloseVideo();
else
- Methods.Try(() => (videoPlaceholder.Content as VideoPage).player.minimize_Click(this, null));
+ try { headers[content.SourcePageType](); }
+ catch { }
}
public void MinimizeVideo()
@@ -346,7 +347,8 @@ namespace FoxTube
SetNavigationMenu();
- Methods.Try(headers[content.SourcePageType]);
+ try { headers[content.SourcePageType](); }
+ catch { }
}
void SetNavigationMenu()
@@ -461,7 +463,8 @@ namespace FoxTube
public void Content_Navigated(object sender, NavigationEventArgs e)
{
- Methods.Try(headers[e.SourcePageType]);
+ try { headers[e.SourcePageType](); }
+ catch { }
if (s == Sender.None)
{
diff --git a/FoxTube/Pages/PlaylistPage.xaml b/FoxTube/Pages/PlaylistPage.xaml
index f4a2e50..59d7843 100644
--- a/FoxTube/Pages/PlaylistPage.xaml
+++ b/FoxTube/Pages/PlaylistPage.xaml
@@ -60,13 +60,13 @@
-
-
+
+
-
+
diff --git a/FoxTube/Pages/PlaylistPage.xaml.cs b/FoxTube/Pages/PlaylistPage.xaml.cs
index 3a65488..70ee05e 100644
--- a/FoxTube/Pages/PlaylistPage.xaml.cs
+++ b/FoxTube/Pages/PlaylistPage.xaml.cs
@@ -63,15 +63,11 @@ namespace FoxTube.Pages
channelName.Text = item.Snippet.ChannelTitle;
- try
- {
- thumbnail.Source = new BitmapImage(new Uri(item.Snippet.Thumbnails.Medium.Url));
- ChannelsResource.ListRequest channelRequest = SecretsVault.Service.Channels.List("snippet");
- channelRequest.Id = item.Snippet.ChannelId;
- Channel channel = (await channelRequest.ExecuteAsync()).Items[0];
- avatar.ProfilePicture = new BitmapImage(new Uri(channel.Snippet.Thumbnails.Medium.Url));
- }
- catch { }
+ thumbnail.Source = new BitmapImage(item.Snippet.Thumbnails.Medium.Url.ToUri());
+ ChannelsResource.ListRequest channelRequest = SecretsVault.Service.Channels.List("snippet");
+ channelRequest.Id = item.Snippet.ChannelId;
+ Channel channel = (await channelRequest.ExecuteAsync()).Items[0];
+ avatar.ProfilePicture = new BitmapImage(channel.Snippet.Thumbnails.Medium.Url.ToUri());
PlaylistItemsResource.ListRequest listRequest = SecretsVault.Service.PlaylistItems.List("contentDetails");
listRequest.PlaylistId = id;
diff --git a/FoxTube/Pages/Search.xaml b/FoxTube/Pages/Search.xaml
index 9533e50..98cd9c4 100644
--- a/FoxTube/Pages/Search.xaml
+++ b/FoxTube/Pages/Search.xaml
@@ -72,11 +72,11 @@
-
+
-
+
diff --git a/FoxTube/Pages/Search.xaml.cs b/FoxTube/Pages/Search.xaml.cs
index a927256..b6fb529 100644
--- a/FoxTube/Pages/Search.xaml.cs
+++ b/FoxTube/Pages/Search.xaml.cs
@@ -8,6 +8,8 @@ using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using Windows.System;
using Windows.ApplicationModel.Resources;
+using Microsoft.AppCenter.Analytics;
+using System.Collections.Generic;
namespace FoxTube
{
@@ -77,7 +79,6 @@ namespace FoxTube
else
loading.Error("ArgumentException", "Wrong parameter");
}
-
}
public async void Initialize(SearchParameters arg)
@@ -100,20 +101,20 @@ namespace FoxTube
request.RegionCode = SettingsStorage.Region;
request.RelevanceLanguage = SettingsStorage.RelevanceLanguage;
- request.MaxResults = 48;
- try
- {
- request.Order = (SearchResource.ListRequest.OrderEnum)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.Order);
- request.Type = (string)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.Type);
- request.PublishedAfter = (DateTime)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.Date);
+ request.MaxResults = 25;
+ request.Order = (SearchResource.ListRequest.OrderEnum)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.Order);
+ request.Type = (string)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.Type);
+ request.PublishedAfter = (DateTime)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.Date);
+
+ if (Parameters.Filter.Type == SearchParameters.Filters.Enumerations.Type.Video)
+ {
request.VideoDefinition = (SearchResource.ListRequest.VideoDefinitionEnum)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.HD);
request.VideoDimension = (SearchResource.ListRequest.VideoDimensionEnum)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.ThreeD);
request.VideoCaption = (SearchResource.ListRequest.VideoCaptionEnum)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.Captions);
request.EventType = (SearchResource.ListRequest.EventTypeEnum)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.LiveEvent);
request.VideoLicense = (SearchResource.ListRequest.VideoLicenseEnum)arg.Filter.GetParameter(SearchParameters.Filters.Enumerations.ConversionType.CreativeCommons);
}
- catch { }
order.SelectedIndex = (int)Parameters.Filter.Order;
type.SelectedIndex = (int)Parameters.Filter.Type;
@@ -150,6 +151,12 @@ namespace FoxTube
catch (Exception e)
{
loading.Error(e.GetType().ToString(), e.Message);
+ Analytics.TrackEvent("Search loading error", new Dictionary()
+ {
+ { "Exception", e.GetType().ToString() },
+ { "Message", e.Message },
+ { "Parameters", Parameters.ToString() }
+ });
}
}