diff --git a/FoxTube.Background/BackgroundProcessor.cs b/FoxTube.Background/BackgroundProcessor.cs
index 706209d..6e06785 100644
--- a/FoxTube.Background/BackgroundProcessor.cs
+++ b/FoxTube.Background/BackgroundProcessor.cs
@@ -11,7 +11,6 @@ using System.Xml;
using Windows.ApplicationModel.Background;
using Windows.Storage;
using Windows.UI.Notifications;
-using YoutubeExplode.Models;
namespace FoxTube.Background
{
@@ -78,13 +77,13 @@ namespace FoxTube.Background
if(i.Snippet.LiveBroadcastContent == "live")
ToastNotificationManager.CreateToastNotifier().Show(
- Notification.GetStreamToast(i.Id.VideoId, i.Snippet.ChannelId, i.Snippet.Title, i.Snippet.ChannelTitle, i.Snippet.Thumbnails.Medium.Url, i.Snippet.PublishedAt.Value, s.Value));
+ Notification.GetStreamToast(i.Id.VideoId, i.Snippet.ChannelId, i.Snippet.Title.ConvertEscapeSymbols(), i.Snippet.ChannelTitle, i.Snippet.Thumbnails.Medium.Url, i.Snippet.PublishedAt.Value, s.Value));
else if(i.Snippet.LiveBroadcastContent == "upcoming")
ToastNotificationManager.CreateToastNotifier().Show(
- Notification.GetUpcomingToast(i.Id.VideoId, i.Snippet.ChannelId, i.Snippet.Title, i.Snippet.ChannelTitle, i.Snippet.Thumbnails.Medium.Url, i.Snippet.PublishedAt.Value, s.Value));
+ Notification.GetUpcomingToast(i.Id.VideoId, i.Snippet.ChannelId, i.Snippet.Title.ConvertEscapeSymbols(), i.Snippet.ChannelTitle, i.Snippet.Thumbnails.Medium.Url, i.Snippet.PublishedAt.Value, s.Value));
else
ToastNotificationManager.CreateToastNotifier().Show(
- Notification.GetVideoToast(i.Id.VideoId, i.Snippet.ChannelId, i.Snippet.Title, i.Snippet.ChannelTitle, i.Snippet.Thumbnails.Medium.Url, i.Snippet.PublishedAt.Value, s.Value));
+ Notification.GetVideoToast(i.Id.VideoId, i.Snippet.ChannelId, i.Snippet.Title.ConvertEscapeSymbols(), i.Snippet.ChannelTitle, i.Snippet.Thumbnails.Medium.Url, i.Snippet.PublishedAt.Value, s.Value));
}
}
@@ -94,7 +93,7 @@ namespace FoxTube.Background
updater.EnableNotificationQueue(true);
updater.Clear();
for (int i = 0; i < 5 && i < results.Count; i++)
- updater.Update(Tiles.GetTileLayout(System.Security.SecurityElement.Escape(results[i].Snippet.Title), System.Security.SecurityElement.Escape(results[i].Snippet.ChannelTitle), results[i].Snippet.Thumbnails.Medium.Url.Replace("&", "%26"), subscriptions[results[i].Snippet.ChannelId]));
+ updater.Update(Tiles.GetTileLayout(System.Security.SecurityElement.Escape(results[i].Snippet.Title.ConvertEscapeSymbols()), System.Security.SecurityElement.Escape(results[i].Snippet.ChannelTitle), results[i].Snippet.Thumbnails.Medium.Url.Replace("&", "%26"), subscriptions[results[i].Snippet.ChannelId]));
}
catch { }
}
@@ -119,4 +118,12 @@ namespace FoxTube.Background
catch { }
}
}
+
+ public static class Ext
+ {
+ public static string ConvertEscapeSymbols(this string str)
+ {
+ return str.Replace(""", "\"").Replace("'", "'").Replace("<", "<").Replace(">", ">").Replace("&", "&");
+ }
+ }
}
diff --git a/FoxTube/App.xaml b/FoxTube/App.xaml
index 93d2f98..3f5f37b 100644
--- a/FoxTube/App.xaml
+++ b/FoxTube/App.xaml
@@ -1,17 +1,14 @@
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
- Red
-
-
-
-
+
+
+
+
+
+
diff --git a/FoxTube/Assets/Data/Patchnotes.xml b/FoxTube/Assets/Data/Patchnotes.xml
index b07d623..5bb3172 100644
--- a/FoxTube/Assets/Data/Patchnotes.xml
+++ b/FoxTube/Assets/Data/Patchnotes.xml
@@ -1,5 +1,43 @@
+ -
+
+ ### What's new:
+- App optimization
+- Changelog notification now pops up after update at first launch
+- Added ability to add videos to playlists on video page
+- Added ability to add videos to playlists through card's context menu
+- Added ability to download video through card's context menu
+- Deleted videos are now also displayed
+- Added support of April 2018 Update (Windows 10 build 17134)
+- Added adverts (not real. Just for debugging)
+- Fixed header titles
+- Some items were moved from menu to header
+- Added "Share" button to video cards
+- Added "Delete video from playlist" button to video cards on playlist page\
+- Improved channel cover quality
+- If available, shows localized titles and descriptions (based on "Search relevance language" parameter set in settings)
+- Updated russian localization
+
+ ### Что нового:
+- Оптимизация приложения
+- Добавлено уведомление со списком изменений при первом запуске после обновления
+- Добавлена возможность добавлять видео в плейлисты на странице просмотра
+- Добавлена возможность добавлять видео в плейлисты через контекстное меню карточки
+- Добавлена возможность скачивать видео через контекстное меню карточки
+- Удаленные видео теперь также отображаются
+- Добавлена поддержка Апрельского Обновления 2018 (Windows 10 сборка 17134)
+- Добавлена реклама (не настоящие. Только для отладки)
+- Исправлено изменение заголовков
+- Некоторые пункты меню перемещены в заголовок
+- Добавлена кнопка "Поделиться" к видео карточкам
+- Добавлена кнопка "Удалить видео из плейлиста" к видео карточкам на страницах плейлистов
+- Улучшено качество обложки канала
+- Показывает локализированные заголовки и описания если доступны (основан на параметре "Предпочитаемый язык поиска" установленного в настройках)
+- Обновлена русская локализация
+
+
+
-
### What's new:
diff --git a/FoxTube/Classes/Methods.cs b/FoxTube/Classes/Methods.cs
index 18890fe..f6ebd82 100644
--- a/FoxTube/Classes/Methods.cs
+++ b/FoxTube/Classes/Methods.cs
@@ -1,27 +1,21 @@
using FoxTube.Pages;
-using Google.Apis.YouTube.v3;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
-using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
-using System.Web;
using System.Xml;
using Windows.ApplicationModel.Core;
using Windows.ApplicationModel.DataTransfer;
using Windows.ApplicationModel.Resources;
-using Windows.ApplicationModel.Resources.Core;
using Windows.Storage;
using Windows.Storage.Streams;
using Windows.System;
-using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Documents;
-using Windows.UI.Xaml.Media;
using YoutubeExplode;
using YoutubeExplode.Models.MediaStreams;
@@ -48,7 +42,18 @@ namespace FoxTube
public static Uri ToUri(this string url)
{
- return new Uri(url);
+ if (string.IsNullOrWhiteSpace(url))
+ return null;
+ else
+ return new Uri(url);
+ }
+
+ public static string GuardFromNull(string str)
+ {
+ if (string.IsNullOrWhiteSpace(str))
+ return string.Empty;
+ else
+ return str;
}
public static string GetChars(this string str, int count)
diff --git a/FoxTube/Classes/SecretsVault.cs b/FoxTube/Classes/SecretsVault.cs
index 990e5a9..cc0c68a 100644
--- a/FoxTube/Classes/SecretsVault.cs
+++ b/FoxTube/Classes/SecretsVault.cs
@@ -42,8 +42,9 @@ namespace FoxTube
};
public static YouTubeService Service => IsAuthorized ? new YouTubeService(Initializer) : NoAuthService;
public static HttpClient HttpClient { get; } = new HttpClient();
- public static string AppId => true ? "d25517cb-12d4-4699-8bdc-52040c712cab" : "9ncqqxjtdlfh";
- public static string AdUnitId => true ? "test" : "1100037769";
+ private static bool TestAds => true; //Change this bool
+ public static string AppId => TestAds ? "d25517cb-12d4-4699-8bdc-52040c712cab" : "9ncqqxjtdlfh";
+ public static string AdUnitId => TestAds ? "test" : "1100044398";
public static bool AdsDisabled { get; private set; } = true;
//User info
@@ -109,9 +110,8 @@ namespace FoxTube
///
public static void Initialize()
{
+ CheckAddons();
CheckAuthorization();
- // TODO: Reactivate addons initialization
- //CheckAddons();
}
///
diff --git a/FoxTube/Classes/SettingsStorage.cs b/FoxTube/Classes/SettingsStorage.cs
index b5a952b..d564172 100644
--- a/FoxTube/Classes/SettingsStorage.cs
+++ b/FoxTube/Classes/SettingsStorage.cs
@@ -161,7 +161,7 @@ namespace FoxTube
{
get
{
- if (storage.Values["ver"] == null)
+ if (storage.Values["version"] == null)
{
PackageVersion ver = Package.Current.Id.Version;
storage.Values["version"] = $"{ver.Major}.{ver.Minor}";
diff --git a/FoxTube/Controls/Adverts/CardAdvert.xaml b/FoxTube/Controls/Adverts/CardAdvert.xaml
index 4f5a4f6..c947886 100644
--- a/FoxTube/Controls/Adverts/CardAdvert.xaml
+++ b/FoxTube/Controls/Adverts/CardAdvert.xaml
@@ -9,7 +9,24 @@
VerticalAlignment="Top"
d:DesignHeight="290"
d:DesignWidth="384"
- Visibility="Collapsed">
+ Visibility="Collapsed"
+ Opacity="0"
+ Name="card">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+