diff --git a/FoxTube.Background/FoxTube.Background.csproj b/FoxTube.Background/FoxTube.Background.csproj index 41111b2..a9896f1 100644 --- a/FoxTube.Background/FoxTube.Background.csproj +++ b/FoxTube.Background/FoxTube.Background.csproj @@ -131,14 +131,13 @@ 6.1.5 - - - ..\..\..\..\..\..\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\microsoft.netcore.universalwindowsplatform\6.1.5\ref\uap10.0.15138\System.Net.WebClient.dll - - + 14.0 + + false + diff --git a/FoxTube/Assets/LargeTile.scale-100.png b/FoxTube/Assets/LargeTile.scale-100.png index b338fa5..6bd2d5d 100644 Binary files a/FoxTube/Assets/LargeTile.scale-100.png and b/FoxTube/Assets/LargeTile.scale-100.png differ diff --git a/FoxTube/Assets/LargeTile.scale-125.png b/FoxTube/Assets/LargeTile.scale-125.png index 9f13122..f39bfbc 100644 Binary files a/FoxTube/Assets/LargeTile.scale-125.png and b/FoxTube/Assets/LargeTile.scale-125.png differ diff --git a/FoxTube/Assets/LargeTile.scale-150.png b/FoxTube/Assets/LargeTile.scale-150.png index 3fbb4ec..6536cd2 100644 Binary files a/FoxTube/Assets/LargeTile.scale-150.png and b/FoxTube/Assets/LargeTile.scale-150.png differ diff --git a/FoxTube/Assets/LargeTile.scale-200.png b/FoxTube/Assets/LargeTile.scale-200.png index 429dd7d..067a34e 100644 Binary files a/FoxTube/Assets/LargeTile.scale-200.png and b/FoxTube/Assets/LargeTile.scale-200.png differ diff --git a/FoxTube/Assets/LargeTile.scale-400.png b/FoxTube/Assets/LargeTile.scale-400.png index ea5dc88..f162c07 100644 Binary files a/FoxTube/Assets/LargeTile.scale-400.png and b/FoxTube/Assets/LargeTile.scale-400.png differ diff --git a/FoxTube/Assets/SmallTile.scale-100.png b/FoxTube/Assets/SmallTile.scale-100.png index d617be7..2b2d279 100644 Binary files a/FoxTube/Assets/SmallTile.scale-100.png and b/FoxTube/Assets/SmallTile.scale-100.png differ diff --git a/FoxTube/Assets/SmallTile.scale-125.png b/FoxTube/Assets/SmallTile.scale-125.png index b563ff6..d495087 100644 Binary files a/FoxTube/Assets/SmallTile.scale-125.png and b/FoxTube/Assets/SmallTile.scale-125.png differ diff --git a/FoxTube/Assets/SmallTile.scale-150.png b/FoxTube/Assets/SmallTile.scale-150.png index efc3d78..80263ec 100644 Binary files a/FoxTube/Assets/SmallTile.scale-150.png and b/FoxTube/Assets/SmallTile.scale-150.png differ diff --git a/FoxTube/Assets/SmallTile.scale-200.png b/FoxTube/Assets/SmallTile.scale-200.png index 7b29662..7029107 100644 Binary files a/FoxTube/Assets/SmallTile.scale-200.png and b/FoxTube/Assets/SmallTile.scale-200.png differ diff --git a/FoxTube/Assets/SmallTile.scale-400.png b/FoxTube/Assets/SmallTile.scale-400.png index 1c7a8d6..e68e897 100644 Binary files a/FoxTube/Assets/SmallTile.scale-400.png and b/FoxTube/Assets/SmallTile.scale-400.png differ diff --git a/FoxTube/Assets/SplashScreen.scale-100.png b/FoxTube/Assets/SplashScreen.scale-100.png index 77e313a..5c05bb5 100644 Binary files a/FoxTube/Assets/SplashScreen.scale-100.png and b/FoxTube/Assets/SplashScreen.scale-100.png differ diff --git a/FoxTube/Assets/SplashScreen.scale-125.png b/FoxTube/Assets/SplashScreen.scale-125.png index 5e5b2ba..d31d279 100644 Binary files a/FoxTube/Assets/SplashScreen.scale-125.png and b/FoxTube/Assets/SplashScreen.scale-125.png differ diff --git a/FoxTube/Assets/SplashScreen.scale-150.png b/FoxTube/Assets/SplashScreen.scale-150.png index 8820ab3..c54b15c 100644 Binary files a/FoxTube/Assets/SplashScreen.scale-150.png and b/FoxTube/Assets/SplashScreen.scale-150.png differ diff --git a/FoxTube/Assets/SplashScreen.scale-200.png b/FoxTube/Assets/SplashScreen.scale-200.png index e83ae40..8ff87be 100644 Binary files a/FoxTube/Assets/SplashScreen.scale-200.png and b/FoxTube/Assets/SplashScreen.scale-200.png differ diff --git a/FoxTube/Assets/SplashScreen.scale-400.png b/FoxTube/Assets/SplashScreen.scale-400.png index 2e242e2..8b8c537 100644 Binary files a/FoxTube/Assets/SplashScreen.scale-400.png and b/FoxTube/Assets/SplashScreen.scale-400.png differ diff --git a/FoxTube/Assets/Square150x150Logo.scale-100.png b/FoxTube/Assets/Square150x150Logo.scale-100.png index 4912ff4..6311043 100644 Binary files a/FoxTube/Assets/Square150x150Logo.scale-100.png and b/FoxTube/Assets/Square150x150Logo.scale-100.png differ diff --git a/FoxTube/Assets/Square150x150Logo.scale-125.png b/FoxTube/Assets/Square150x150Logo.scale-125.png index 80b2d1f..6b74407 100644 Binary files a/FoxTube/Assets/Square150x150Logo.scale-125.png and b/FoxTube/Assets/Square150x150Logo.scale-125.png differ diff --git a/FoxTube/Assets/Square150x150Logo.scale-150.png b/FoxTube/Assets/Square150x150Logo.scale-150.png index 6cf113b..3d6a09f 100644 Binary files a/FoxTube/Assets/Square150x150Logo.scale-150.png and b/FoxTube/Assets/Square150x150Logo.scale-150.png differ diff --git a/FoxTube/Assets/Square150x150Logo.scale-200.png b/FoxTube/Assets/Square150x150Logo.scale-200.png index feb190f..f42ad59 100644 Binary files a/FoxTube/Assets/Square150x150Logo.scale-200.png and b/FoxTube/Assets/Square150x150Logo.scale-200.png differ diff --git a/FoxTube/Assets/Square150x150Logo.scale-400.png b/FoxTube/Assets/Square150x150Logo.scale-400.png index d226fce..6fb7558 100644 Binary files a/FoxTube/Assets/Square150x150Logo.scale-400.png and b/FoxTube/Assets/Square150x150Logo.scale-400.png differ diff --git a/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-16.png b/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-16.png index ed3277d..4190717 100644 Binary files a/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-16.png and b/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-16.png differ diff --git a/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-256.png b/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-256.png index 39790c6..3f8b07f 100644 Binary files a/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-256.png and b/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-256.png differ diff --git a/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-32.png b/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-32.png index add1a0d..966ef2c 100644 Binary files a/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-32.png and b/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-32.png differ diff --git a/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-48.png b/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-48.png index 3b74fae..d5566cd 100644 Binary files a/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-48.png and b/FoxTube/Assets/Square44x44Logo.altform-unplated_targetsize-48.png differ diff --git a/FoxTube/Assets/Square44x44Logo.scale-100.png b/FoxTube/Assets/Square44x44Logo.scale-100.png index 5900856..4d54ade 100644 Binary files a/FoxTube/Assets/Square44x44Logo.scale-100.png and b/FoxTube/Assets/Square44x44Logo.scale-100.png differ diff --git a/FoxTube/Assets/Square44x44Logo.scale-125.png b/FoxTube/Assets/Square44x44Logo.scale-125.png index dedc1da..1d10473 100644 Binary files a/FoxTube/Assets/Square44x44Logo.scale-125.png and b/FoxTube/Assets/Square44x44Logo.scale-125.png differ diff --git a/FoxTube/Assets/Square44x44Logo.scale-150.png b/FoxTube/Assets/Square44x44Logo.scale-150.png index 27f4b81..532eeb5 100644 Binary files a/FoxTube/Assets/Square44x44Logo.scale-150.png and b/FoxTube/Assets/Square44x44Logo.scale-150.png differ diff --git a/FoxTube/Assets/Square44x44Logo.scale-200.png b/FoxTube/Assets/Square44x44Logo.scale-200.png index 40e041d..a388b69 100644 Binary files a/FoxTube/Assets/Square44x44Logo.scale-200.png and b/FoxTube/Assets/Square44x44Logo.scale-200.png differ diff --git a/FoxTube/Assets/Square44x44Logo.scale-400.png b/FoxTube/Assets/Square44x44Logo.scale-400.png index c3cf925..952b836 100644 Binary files a/FoxTube/Assets/Square44x44Logo.scale-400.png and b/FoxTube/Assets/Square44x44Logo.scale-400.png differ diff --git a/FoxTube/Assets/Square44x44Logo.targetsize-16.png b/FoxTube/Assets/Square44x44Logo.targetsize-16.png index 75918f2..ae65581 100644 Binary files a/FoxTube/Assets/Square44x44Logo.targetsize-16.png and b/FoxTube/Assets/Square44x44Logo.targetsize-16.png differ diff --git a/FoxTube/Assets/Square44x44Logo.targetsize-24.png b/FoxTube/Assets/Square44x44Logo.targetsize-24.png index 9188bbe..2e920ea 100644 Binary files a/FoxTube/Assets/Square44x44Logo.targetsize-24.png and b/FoxTube/Assets/Square44x44Logo.targetsize-24.png differ diff --git a/FoxTube/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/FoxTube/Assets/Square44x44Logo.targetsize-24_altform-unplated.png index 5d3b730..157e51b 100644 Binary files a/FoxTube/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and b/FoxTube/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/FoxTube/Assets/Square44x44Logo.targetsize-256.png b/FoxTube/Assets/Square44x44Logo.targetsize-256.png index 075c6ef..c512e4f 100644 Binary files a/FoxTube/Assets/Square44x44Logo.targetsize-256.png and b/FoxTube/Assets/Square44x44Logo.targetsize-256.png differ diff --git a/FoxTube/Assets/Square44x44Logo.targetsize-32.png b/FoxTube/Assets/Square44x44Logo.targetsize-32.png index 9437baa..e21a640 100644 Binary files a/FoxTube/Assets/Square44x44Logo.targetsize-32.png and b/FoxTube/Assets/Square44x44Logo.targetsize-32.png differ diff --git a/FoxTube/Assets/Square44x44Logo.targetsize-48.png b/FoxTube/Assets/Square44x44Logo.targetsize-48.png index 8ca545e..9fb449f 100644 Binary files a/FoxTube/Assets/Square44x44Logo.targetsize-48.png and b/FoxTube/Assets/Square44x44Logo.targetsize-48.png differ diff --git a/FoxTube/Assets/StoreLogo.scale-100.png b/FoxTube/Assets/StoreLogo.scale-100.png index 3ab11f5..7a7928b 100644 Binary files a/FoxTube/Assets/StoreLogo.scale-100.png and b/FoxTube/Assets/StoreLogo.scale-100.png differ diff --git a/FoxTube/Assets/StoreLogo.scale-125.png b/FoxTube/Assets/StoreLogo.scale-125.png index cb504c8..6c6be97 100644 Binary files a/FoxTube/Assets/StoreLogo.scale-125.png and b/FoxTube/Assets/StoreLogo.scale-125.png differ diff --git a/FoxTube/Assets/StoreLogo.scale-150.png b/FoxTube/Assets/StoreLogo.scale-150.png index 8b8b63b..22ec353 100644 Binary files a/FoxTube/Assets/StoreLogo.scale-150.png and b/FoxTube/Assets/StoreLogo.scale-150.png differ diff --git a/FoxTube/Assets/StoreLogo.scale-200.png b/FoxTube/Assets/StoreLogo.scale-200.png index 4e8cf47..1b8d85e 100644 Binary files a/FoxTube/Assets/StoreLogo.scale-200.png and b/FoxTube/Assets/StoreLogo.scale-200.png differ diff --git a/FoxTube/Assets/StoreLogo.scale-400.png b/FoxTube/Assets/StoreLogo.scale-400.png index 67f49b5..9a0689c 100644 Binary files a/FoxTube/Assets/StoreLogo.scale-400.png and b/FoxTube/Assets/StoreLogo.scale-400.png differ diff --git a/FoxTube/Assets/Wide310x150Logo.scale-100.png b/FoxTube/Assets/Wide310x150Logo.scale-100.png index 90bc98f..ff3b8a5 100644 Binary files a/FoxTube/Assets/Wide310x150Logo.scale-100.png and b/FoxTube/Assets/Wide310x150Logo.scale-100.png differ diff --git a/FoxTube/Assets/Wide310x150Logo.scale-125.png b/FoxTube/Assets/Wide310x150Logo.scale-125.png index 0220830..091bc37 100644 Binary files a/FoxTube/Assets/Wide310x150Logo.scale-125.png and b/FoxTube/Assets/Wide310x150Logo.scale-125.png differ diff --git a/FoxTube/Assets/Wide310x150Logo.scale-150.png b/FoxTube/Assets/Wide310x150Logo.scale-150.png index cc9bfc9..0a54bc8 100644 Binary files a/FoxTube/Assets/Wide310x150Logo.scale-150.png and b/FoxTube/Assets/Wide310x150Logo.scale-150.png differ diff --git a/FoxTube/Assets/Wide310x150Logo.scale-200.png b/FoxTube/Assets/Wide310x150Logo.scale-200.png index 77e313a..66e475d 100644 Binary files a/FoxTube/Assets/Wide310x150Logo.scale-200.png and b/FoxTube/Assets/Wide310x150Logo.scale-200.png differ diff --git a/FoxTube/Assets/Wide310x150Logo.scale-400.png b/FoxTube/Assets/Wide310x150Logo.scale-400.png index e83ae40..ffd0bd7 100644 Binary files a/FoxTube/Assets/Wide310x150Logo.scale-400.png and b/FoxTube/Assets/Wide310x150Logo.scale-400.png differ diff --git a/FoxTube/Classes/Caption.cs b/FoxTube/Classes/Caption.cs deleted file mode 100644 index f971aa1..0000000 --- a/FoxTube/Classes/Caption.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FoxTube.Classes -{ - public class Caption - { - public TimeSpan Start { get; private set; } - public TimeSpan Duration { get; private set; } - public TimeSpan End - { - get { return Start + Duration; } - } - public string Text { get; private set; } - - public Caption(int startTime, int duration, string text) - { - Start = TimeSpan.FromMilliseconds(startTime); - Duration = TimeSpan.FromMilliseconds(duration); - Text = text; - } - - public Caption(double startTime, double duration, string text) - { - Start = TimeSpan.FromSeconds(startTime); - Duration = TimeSpan.FromSeconds(duration); - Text = text; - } - } -} diff --git a/FoxTube/Classes/InboxItem.cs b/FoxTube/Classes/InboxItem.cs index 7eaaa48..640d8e5 100644 --- a/FoxTube/Classes/InboxItem.cs +++ b/FoxTube/Classes/InboxItem.cs @@ -1,5 +1,6 @@ using System; using System.Xml; +using Windows.ApplicationModel.Resources; namespace FoxTube.Classes { @@ -13,6 +14,8 @@ namespace FoxTube.Classes public string Subject { get; set; } public string Content { get; set; } public string Id { get; set; } + + private ResourceLoader resources = ResourceLoader.GetForCurrentView("Inbox"); public string Icon { @@ -29,9 +32,9 @@ namespace FoxTube.Classes get { if (Type == InboxItemType.PatchNote) - return "Patch note"; + return resources.GetString("changelog"); else - return "Developer's message"; + return resources.GetString("dev"); } } @@ -40,7 +43,7 @@ namespace FoxTube.Classes get { if (Type == InboxItemType.PatchNote) - return $"What's new in v{Id}"; + return $"{resources.GetString("whatsnew")}{Id}"; else return Subject; } diff --git a/FoxTube/Classes/Methods.cs b/FoxTube/Classes/Methods.cs index fef6a3f..7013a5a 100644 --- a/FoxTube/Classes/Methods.cs +++ b/FoxTube/Classes/Methods.cs @@ -1,4 +1,7 @@ -using Google.Apis.YouTube.v3; +using FoxTube.Controls.Adverts; +using FoxTube.Pages; +using Google.Apis.YouTube.v3; +using Microsoft.Advertising.WinRT.UI; using System; using System.Collections.Generic; using System.Diagnostics; @@ -6,8 +9,10 @@ using System.IO; using System.Linq; using System.Text.RegularExpressions; using System.Web; +using System.Xml; using Windows.ApplicationModel.Core; using Windows.ApplicationModel.DataTransfer; +using Windows.ApplicationModel.Resources; using Windows.Storage; using Windows.Storage.Streams; using Windows.System; @@ -16,11 +21,15 @@ using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Documents; using Windows.UI.Xaml.Media; +using YoutubeExplode.Models.MediaStreams; namespace FoxTube { public static class Methods { + private static ResourceLoader resources = ResourceLoader.GetForCurrentView("Methods"); + public static CommentsPage CommentsPage { get; set; } + public static bool NeedToResponse { get; set; } = false; public static MainPage MainPage { @@ -37,6 +46,30 @@ namespace FoxTube return new Uri(url); } + public static string GetChars(this string str, int count) + { + try + { + string s = ""; + for (int i = 0; i < count; i++) + s += str[i]; + return s; + } + catch + { + return ""; + } + } + + public static List ToReversedList(this Array array) + { + List list = new List(); + foreach (object i in array) + list.Add(i); + list.Reverse(); + return list; + } + public static void ForEach(this IEnumerable array, Action action) { array.ToList().ForEach(action); @@ -64,36 +97,56 @@ namespace FoxTube return arr[arr.Length - 1]; } + public static TimeSpan GetDuration(this string str) + { + try + { + return XmlConvert.ToTimeSpan(str); + } + catch (FormatException) + { + TimeSpan time = XmlConvert.ToTimeSpan("PT" + str.Split('T')[1]); + TimeSpan date = TimeSpan.FromDays(int.Parse(str.Split('W')[0].Replace("P", "")) * 7); + date.Add(time); + + return date; + } + catch + { + return TimeSpan.FromMilliseconds(0); + } + } + public static string GetAgo(DateTime dateTime) { TimeSpan span = DateTime.Now - dateTime; if (span.TotalMinutes < 1) - return "Just now"; + return resources.GetString("/Methods/now"); else if (Math.Round(span.TotalMinutes) == 1) - return "1 minute ago"; + return resources.GetString("/Methods/oneMinute"); else if (span.TotalMinutes < 60) - return Math.Round(span.TotalMinutes) + " minutes ago"; + return Math.Round(span.TotalMinutes) + " " + resources.GetString("/Methods/minutes"); else if (Math.Round(span.TotalHours) == 1) - return "1 hour ago"; + return resources.GetString("/Methods/oneHr"); else if (span.TotalHours < 24) - return Math.Round(span.TotalHours) + " hours ago"; + return Math.Round(span.TotalHours) + " " + resources.GetString("/Methods/hrs"); else if (Math.Round(span.TotalDays) == 1) - return "1 day ago"; + return resources.GetString("/Methods/oneDay"); else if (span.TotalDays < 7) - return Math.Round(span.TotalDays) + " days ago"; + return Math.Round(span.TotalDays) + " " + resources.GetString("/Methods/days"); else if (Math.Round(span.TotalDays) == 7) - return "1 week ago"; + return resources.GetString("/Methods/oneWeek"); else if (span.TotalDays < 30) - return Math.Round(span.TotalDays / 7) + " weeks ago"; + return Math.Round(span.TotalDays / 7) + " " + resources.GetString("/Methods/weeks"); else if (Math.Round(span.TotalDays) == 30) - return "1 month ago"; + return resources.GetString("/Methods/oneMonth"); else if (Math.Round(span.TotalDays) < 365) - return Math.Round(span.TotalDays / 30) + " months ago"; + return Math.Round(span.TotalDays / 30) + " " + resources.GetString("/Methods/months"); else if (Math.Round(span.TotalDays / 365) == 365) - return "1 year ago"; + return resources.GetString("/Methods/oneYear"); else - return Math.Round(span.TotalDays / 365) + " years ago"; + return Math.Round(span.TotalDays / 365) + " " + resources.GetString("/Methods/years"); } public static void FormatText(ref TextBlock block, string text) @@ -139,6 +192,37 @@ namespace FoxTube } } + public static string GetVideoQualityLabel(this VideoQuality quality) + { + switch (quality) + { + case VideoQuality.High1080: + return "1080p"; + case VideoQuality.High1440: + return "1440p"; + case VideoQuality.High2160: + return "2160p"; + case VideoQuality.High2880: + return "2880p"; + case VideoQuality.High3072: + return "3072p"; + case VideoQuality.High4320: + return "4320p"; + case VideoQuality.High720: + return "720p"; + case VideoQuality.Low144: + return "144p"; + case VideoQuality.Low240: + return "240p"; + case VideoQuality.Medium360: + return "360p"; + case VideoQuality.Medium480: + return "480p"; + default: + return "Unknown"; + } + } + /*public static string QualityToString(YouTubeQuality quality) { switch(quality) @@ -242,7 +326,7 @@ namespace FoxTube { DataRequest request = args.Request; request.Data.Properties.Title = title; - request.Data.Properties.Description = $"Sharing a {type}"; + request.Data.Properties.Description = $"{resources.GetString("/Methods/sharing")} {type}"; request.Data.SetText(title + "\n" + "#YouTube #FoxTube #SharedWithFoxTube"); request.Data.SetWebLink(url.ToUri()); diff --git a/FoxTube/Classes/SecretsVault.cs b/FoxTube/Classes/SecretsVault.cs index 707599e..55fe10f 100644 --- a/FoxTube/Classes/SecretsVault.cs +++ b/FoxTube/Classes/SecretsVault.cs @@ -8,6 +8,7 @@ using Google.Apis.YouTube.v3; using Google.Apis.YouTube.v3.Data; using Newtonsoft.Json; using Windows.Storage; +using Windows.Services.Store; namespace FoxTube { @@ -17,7 +18,7 @@ namespace FoxTube //Events public static event ObjectEventHandler AuthorizationStateChanged; public static event ObjectEventHandler SubscriptionsChanged; - public static event Event NotPurchased; //Rising when app finds out that it's not a PRO version + public static event ObjectEventHandler Purchased; //Rising when app finds out that it's not a PRO version //Private properties private static ClientSecrets Secrets => new ClientSecrets() @@ -36,6 +37,8 @@ namespace FoxTube ApplicationName = "FoxTube" }; public static YouTubeService Service => IsAuthorized ? new YouTubeService(Initializer) : NoAuthService; + public static string AppId => true ? "d25517cb-12d4-4699-8bdc-52040c712cab" : "9ncqqxjtdlfh"; + public static string AdUnitId => true ? "test" : "1100037769"; public static bool AdsDisabled { get; private set; } = true; //User info @@ -193,15 +196,38 @@ namespace FoxTube /// /// Connects to MS Store and checks if user has bought ad-free /// - public static void CheckAddons() + public static async void CheckAddons() { - //TODO: Check addons list - bool purchased = true; - - if(!purchased) + try { - AdsDisabled = false; - NotPurchased?.Invoke(); + StoreContext store = StoreContext.GetDefault(); + StoreProductQueryResult requset = await store.GetAssociatedStoreProductsAsync(new[] { "Consumable", "Durable", "UnmanagedConsumable" }); + + if (!requset.Products["foxtube-adsremove"].IsInUserCollection) + { + AdsDisabled = false; + Purchased?.Invoke(args:false); + } + } + catch { } + } + + public static async void GetAdblock() + { + StoreContext store = StoreContext.GetDefault(); + StorePurchaseResult request = await store.RequestPurchaseAsync("foxtube-adsremove"); + + switch (request.Status) + { + case StorePurchaseStatus.AlreadyPurchased: + Purchased?.Invoke(args: true); + AdsDisabled = true; + break; + + case StorePurchaseStatus.Succeeded: + Purchased?.Invoke(args: true); + AdsDisabled = true; + break; } } #endregion diff --git a/FoxTube/Classes/SettingsStorage.cs b/FoxTube/Classes/SettingsStorage.cs index 6ce1403..9a58a04 100644 --- a/FoxTube/Classes/SettingsStorage.cs +++ b/FoxTube/Classes/SettingsStorage.cs @@ -7,6 +7,8 @@ using Windows.Storage; namespace FoxTube { + public enum MatureState { Blocked, Allowed, AllowedOnce } + public static class SettingsStorage { public static string VideoQuality @@ -84,7 +86,7 @@ namespace FoxTube SaveData(); } } - public static string Region + public static string RelevanceLanguage { get { return (string)settings[8]; } set @@ -93,17 +95,16 @@ namespace FoxTube SaveData(); } } - public static int SafeSearch + public static string Region { - get { return Convert.ToInt32(settings[9]); } + get { return (string)settings[9]; } set { settings[9] = value; SaveData(); } } - - public static int Theme + public static int SafeSearch { get { return Convert.ToInt32(settings[10]); } set @@ -112,15 +113,25 @@ namespace FoxTube SaveData(); } } - public static bool HasAccount + + public static int Theme { - get { return (bool)settings[11]; } + get { return Convert.ToInt32(settings[11]); } set { settings[11] = value; SaveData(); } } + public static bool HasAccount + { + get { return (bool)settings[12]; } + set + { + settings[12] = value; + SaveData(); + } + } public static string Version { @@ -139,9 +150,25 @@ namespace FoxTube storage.Values["version"] = value; } } + public static MatureState Mature + { + get + { + if (storage.Values["mature"] == null) + { + storage.Values["mature"] = MatureState.Blocked; + return MatureState.Blocked; + } + else return (MatureState)storage.Values["mature"]; + } + set + { + storage.Values["mature"] = value; + } + } //Settings storage - private static readonly ApplicationDataContainer storage = ApplicationData.Current.LocalSettings; + private static readonly ApplicationDataContainer storage = ApplicationData.Current.RoamingSettings; //Predefined preferences private static object[] settings = new object[] @@ -157,7 +184,8 @@ namespace FoxTube 100, (new[] { "ua", "ru", "by", "kz", "kg", "md", "lv", "ee" }).Contains(CultureInfo.InstalledUICulture.TwoLetterISOLanguageName) ? "ru-RU" : "en-US", - CultureInfo.CurrentCulture.Name, + (new[] { "ua", "ru", "by", "kz", "kg", "md", "lv", "ee" }).Contains(CultureInfo.InstalledUICulture.TwoLetterISOLanguageName) ? "ru" : "en", + (new[] { "ua", "ru", "by", "kz", "kg", "md", "lv", "ee" }).Contains(CultureInfo.InstalledUICulture.TwoLetterISOLanguageName) ? "ru" : "US", 0, 2, @@ -166,14 +194,53 @@ namespace FoxTube public static void LoadData() { + /*if(true && (storage.Values["forceUpdate"] == null || storage.Values["forceUpdate"].ToString() != Version)) + { + SaveData(); + storage.Values["forceUpdate"] = Version; + return; + }*/ + try { - settings = JsonConvert.DeserializeObject(storage.Values["settings"] as string); + object[] saved = JsonConvert.DeserializeObject(storage.Values["settings"] as string); + if (settings.Length > saved.Length) + { + if (saved[0] is string) + settings[0] = saved; + if (saved[1] is string) + settings[1] = saved; + if (saved[2] is bool) + settings[2] = saved; + if (saved[3] is bool) + settings[3] = saved; + if (saved[4] is bool) + settings[4] = saved; + if (saved[5] is bool) + settings[5] = saved; + if (saved[6] is int) + settings[6] = saved; + if (saved[7] is string) + settings[7] = saved; + if (saved[8] is string) + settings[8] = saved; + if (saved[9] is string) + settings[9] = saved; + if (saved[10] is int) + settings[10] = saved; + if (saved[11] is int) + settings[11] = saved; + if (saved[12] is bool) + settings[12] = saved; + + SaveData(); + } + else settings = saved; } catch (ArgumentNullException) { } } - public static async void SaveData() + public static void SaveData() { storage.Values["settings"] = JsonConvert.SerializeObject(settings); ExportSettings(); diff --git a/FoxTube/Controls/Advert.xaml.cs b/FoxTube/Controls/Advert.xaml.cs index dfdf5e7..36d3b90 100644 --- a/FoxTube/Controls/Advert.xaml.cs +++ b/FoxTube/Controls/Advert.xaml.cs @@ -36,7 +36,7 @@ namespace FoxTube.Controls Visibility = Visibility.Visible; else Visibility = Visibility.Collapsed; - SecretsVault.NotPurchased += () => Visibility = Visibility.Visible; + SecretsVault.Purchased += (s, e) => Visibility = (bool)e[0] ? Visibility.Collapsed : Visibility.Visible; } private void Grid_SizeChanged(object sender, SizeChangedEventArgs e) diff --git a/FoxTube/Controls/Adverts/CardAdvert.xaml b/FoxTube/Controls/Adverts/CardAdvert.xaml new file mode 100644 index 0000000..8582208 --- /dev/null +++ b/FoxTube/Controls/Adverts/CardAdvert.xaml @@ -0,0 +1,44 @@ + + + + diff --git a/FoxTube/Controls/Adverts/CardAdvert.xaml.cs b/FoxTube/Controls/Adverts/CardAdvert.xaml.cs new file mode 100644 index 0000000..64fd8e8 --- /dev/null +++ b/FoxTube/Controls/Adverts/CardAdvert.xaml.cs @@ -0,0 +1,62 @@ +using System.Linq; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Microsoft.Advertising.WinRT.UI; +using Windows.UI.Xaml.Media.Imaging; + +namespace FoxTube.Controls.Adverts +{ + /// + /// Advert which is looks similar to video cards + /// + public sealed partial class CardAdvert : UserControl + { + NativeAdsManagerV2 manager = new NativeAdsManagerV2(SecretsVault.AppId, SecretsVault.AdUnitId); + public NativeAdV2 advert; + public CardAdvert() + { + InitializeComponent(); + manager.AdReady += AdReady; + manager.RequestAd(); + } + + private void AdReady(object sender, NativeAdReadyEventArgs e) + { + advert = e.NativeAd; + Initialize(); + e.NativeAd.RegisterAdContainer(this); + } + + public void Initialize() + { + title.Text = advert.Title; + image.Source = new BitmapImage(advert.MainImages.First().Url.ToUri()); + if (advert.AdIcon == null) + contentGrid.ColumnDefinitions[0].Width = new GridLength(0); + else + icon.ProfilePicture = advert.AdIcon.Source; + + if (string.IsNullOrWhiteSpace(advert.SponsoredBy)) + sponsor.Visibility = Visibility.Collapsed; + else + sponsor.Text = advert.SponsoredBy; + + if (!string.IsNullOrWhiteSpace(advert.Rating)) + info.Text += $" {advert.Rating}"; + + if (string.IsNullOrWhiteSpace(advert.CallToActionText) && string.IsNullOrWhiteSpace(advert.Price)) + desc.Visibility = Visibility.Collapsed; + else if (!string.IsNullOrWhiteSpace(advert.CallToActionText)) + desc.Text = advert.CallToActionText; + else + desc.Text = advert.Price; + + Visibility = Visibility.Visible; + } + + private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e) + { + Height = e.NewSize.Width * 0.75; + } + } +} diff --git a/FoxTube/Controls/ChannelCard.xaml b/FoxTube/Controls/ChannelCard.xaml index 7ad27ae..79ccc3d 100644 --- a/FoxTube/Controls/ChannelCard.xaml +++ b/FoxTube/Controls/ChannelCard.xaml @@ -20,7 +20,7 @@ - + @@ -36,20 +36,29 @@ - + - Log in to manage your subscriptions + Log in to manage your subscriptions - + + + + + + + + + diff --git a/FoxTube/Controls/ChannelCard.xaml.cs b/FoxTube/Controls/ChannelCard.xaml.cs index 327417d..5a9bcec 100644 --- a/FoxTube/Controls/ChannelCard.xaml.cs +++ b/FoxTube/Controls/ChannelCard.xaml.cs @@ -1,34 +1,30 @@ using Google.Apis.YouTube.v3; using Google.Apis.YouTube.v3.Data; using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; +using Windows.ApplicationModel.DataTransfer; +using Windows.ApplicationModel.Resources; +using Windows.System; using Windows.UI; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media.Imaging; -using Windows.UI.Xaml.Navigation; - -// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 namespace FoxTube.Controls { + /// + /// Channel item card + /// public sealed partial class ChannelCard : UserControl { + ResourceLoader resources = ResourceLoader.GetForCurrentView("Cards"); + string channelId; Channel item; public ChannelCard(string id, string live = "null") { - this.InitializeComponent(); + InitializeComponent(); Initialize(id, live); } @@ -48,8 +44,8 @@ namespace FoxTube.Controls title.Text = item.Snippet.Title; - subs.Text = $"{item.Statistics.SubscriberCount:0,0} subscribers"; - uploads.Text = $"{item.Statistics.VideoCount:0,0} videos"; + subs.Text = $"{item.Statistics.SubscriberCount:0,0} {resources.GetString("/Cards/subscribers")}"; + uploads.Text = $"{item.Statistics.VideoCount:0,0} {resources.GetString("/Cards/videos")}"; if (live == "live") liveTag.Visibility = Visibility.Visible; @@ -62,7 +58,7 @@ namespace FoxTube.Controls { subscribe.Background = new SolidColorBrush(Colors.Transparent); subscribe.Foreground = new SolidColorBrush(Colors.Gray); - subscribe.Content = "Subscribed"; + subscribe.Content = resources.GetString("/Cards/unsubscribe"); } } subscriptionPane.Visibility = Visibility.Visible; @@ -74,7 +70,7 @@ namespace FoxTube.Controls { if (item.BrandingSettings.Image.BannerImageUrl.Contains("default")) 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 { } } @@ -95,14 +91,26 @@ namespace FoxTube.Controls { subscribe.Background = new SolidColorBrush(Colors.Transparent); subscribe.Foreground = new SolidColorBrush(Colors.Gray); - subscribe.Content = "Subscribed"; + subscribe.Content = resources.GetString("/Cards/unsubscribe"); } else { subscribe.Background = new SolidColorBrush(Colors.Red); subscribe.Foreground = new SolidColorBrush(Colors.White); - subscribe.Content = "Subscribe"; + subscribe.Content = resources.GetString("/Cards/subscribe/Content"); } } + + private void GetLink_Click(object sender, RoutedEventArgs e) + { + DataPackage data = new DataPackage(); + data.SetText(string.IsNullOrWhiteSpace(item.Snippet.CustomUrl) ? $"https://www.youtube.com/channel/{item.Id}" : $"https://www.youtube.com/user/{item.Snippet.CustomUrl}"); + Clipboard.SetContent(data); + } + + private async void InBrowser_Click(object sender, RoutedEventArgs e) + { + await Launcher.LaunchUriAsync((string.IsNullOrWhiteSpace(item.Snippet.CustomUrl) ? $"https://www.youtube.com/channel/{item.Id}" : $"https://www.youtube.com/user/{item.Snippet.CustomUrl}").ToUri()); + } } } diff --git a/FoxTube/Controls/Chat.xaml b/FoxTube/Controls/Chat.xaml new file mode 100644 index 0000000..0968ad0 --- /dev/null +++ b/FoxTube/Controls/Chat.xaml @@ -0,0 +1,76 @@ + + + + + + + + + + + @@ -78,7 +77,7 @@ Height="35"> - + @@ -86,7 +85,7 @@ - @@ -47,7 +47,7 @@ - + + + + + + + + + + diff --git a/FoxTube/Controls/PlaylistCard.xaml.cs b/FoxTube/Controls/PlaylistCard.xaml.cs index a59f08c..ddcbc0f 100644 --- a/FoxTube/Controls/PlaylistCard.xaml.cs +++ b/FoxTube/Controls/PlaylistCard.xaml.cs @@ -1,6 +1,8 @@ using Google.Apis.YouTube.v3; using Google.Apis.YouTube.v3.Data; using System; +using Windows.ApplicationModel.DataTransfer; +using Windows.System; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media.Imaging; @@ -40,7 +42,7 @@ namespace FoxTube.Controls 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)); } catch { } } @@ -54,5 +56,22 @@ namespace FoxTube.Controls { Methods.MainPage.GoToPlaylist(item.Id); } + + private void OpenChannel_Click(object sender, RoutedEventArgs e) + { + Methods.MainPage.GoToChannel(item.Snippet.ChannelId); + } + + private void GetLink_Click(object sender, RoutedEventArgs e) + { + DataPackage data = new DataPackage(); + data.SetText($"https://www.youtube.com/playlist?list={playlistId}"); + Clipboard.SetContent(data); + } + + private async void InBrowser_Click(object sender, RoutedEventArgs e) + { + await Launcher.LaunchUriAsync($"https://www.youtube.com/playlist?list={playlistId}".ToUri()); + } } } diff --git a/FoxTube/Controls/ShowMore.xaml b/FoxTube/Controls/ShowMore.xaml index 2c57b25..ea507f5 100644 --- a/FoxTube/Controls/ShowMore.xaml +++ b/FoxTube/Controls/ShowMore.xaml @@ -8,7 +8,7 @@ mc:Ignorable="d"> - + diff --git a/FoxTube/Controls/VideoCard.xaml b/FoxTube/Controls/VideoCard.xaml index 133eb85..804e5cb 100644 --- a/FoxTube/Controls/VideoCard.xaml +++ b/FoxTube/Controls/VideoCard.xaml @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -44,22 +44,28 @@ - + - + - - + + + + + + + - - - - + + + + + diff --git a/FoxTube/Controls/VideoCard.xaml.cs b/FoxTube/Controls/VideoCard.xaml.cs index 4ad9977..f02673d 100644 --- a/FoxTube/Controls/VideoCard.xaml.cs +++ b/FoxTube/Controls/VideoCard.xaml.cs @@ -4,22 +4,26 @@ using Windows.UI.Xaml.Controls; using Google.Apis.YouTube.v3; using Google.Apis.YouTube.v3.Data; using Windows.UI.Xaml.Media.Imaging; -using System.Xml; using Windows.System; -using Windows.UI.Popups; +using Windows.ApplicationModel.DataTransfer; +using Windows.ApplicationModel.Resources; namespace FoxTube.Controls { + /// + /// Video item card + /// public sealed partial class VideoCard : UserControl { + ResourceLoader resources = ResourceLoader.GetForCurrentView("Cards"); + public string playlistId; public string videoId; Video item; - - bool embed = true; + public VideoCard(string id, string playlist = null) { - this.InitializeComponent(); + InitializeComponent(); Initialize(id, playlist); } @@ -42,7 +46,7 @@ namespace FoxTube.Controls channelName.Text = item.Snippet.ChannelTitle; if (item.Snippet.LiveBroadcastContent == "live") { - views.Text = $"{item.LiveStreamingDetails.ConcurrentViewers:0,0} viewers"; + views.Text = $"{item.LiveStreamingDetails.ConcurrentViewers:0,0} {resources.GetString("/Cards/viewers")}"; if (item.LiveStreamingDetails.ScheduledStartTime.HasValue && item.LiveStreamingDetails.ScheduledEndTime.HasValue) info.Text = $"{item.LiveStreamingDetails.ScheduledEndTime - item.LiveStreamingDetails.ScheduledStartTime} | {Methods.GetAgo(item.LiveStreamingDetails.ActualStartTime.Value)}"; else @@ -59,14 +63,13 @@ namespace FoxTube.Controls liveTag.Visibility = Visibility.Visible; if (item.LiveStreamingDetails.ScheduledStartTime.HasValue && (item.LiveStreamingDetails.ScheduledStartTime - DateTime.Now).Value.TotalMilliseconds > 0) - liveContent.Text = $"Goes live in {item.LiveStreamingDetails.ScheduledStartTime}"; - else liveContent.Text = "Upcoming"; + liveContent.Text = $"{resources.GetString("/Cards/goesLive")} {item.LiveStreamingDetails.ScheduledStartTime}"; + else liveContent.Text = resources.GetString("/Cards/upcoming"); } else { - views.Text = $"{item.Statistics.ViewCount:0,0} views"; - info.Text = $"{XmlConvert.ToTimeSpan(item.ContentDetails.Duration)} | {Methods.GetAgo(item.Snippet.PublishedAt.Value)}"; - embed = false; + views.Text = $"{item.Statistics.ViewCount:0,0} {resources.GetString("/Cards/views")}"; + info.Text = $"{item.ContentDetails.Duration.GetDuration()} | {Methods.GetAgo(item.Snippet.PublishedAt.Value)}"; } var request1 = SecretsVault.Service.Channels.List("snippet"); @@ -76,7 +79,7 @@ namespace FoxTube.Controls try { 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 { } @@ -87,23 +90,26 @@ namespace FoxTube.Controls }*/ } - public async void Button_Click(object sender, RoutedEventArgs e) + public void Button_Click(object sender, RoutedEventArgs e) { - if (embed) - { - MessageDialog dialog = new MessageDialog("Unfortunately, at this stage of application development we don't support live steams. This issue will be fixed in the next update. Sorry. Would you like us to open this stream in browser?", "Open in browser"); + Methods.MainPage.GoToVideo(videoId, playlistId); + } - dialog.Commands.Add(new UICommand("Yes", async (command) => - { - await Launcher.LaunchUriAsync(new Uri($"https://www.youtube.com/watch?v={videoId}")); - })); - dialog.Commands.Add(new UICommand("No")); - dialog.DefaultCommandIndex = 0; - dialog.CancelCommandIndex = 1; - await dialog.ShowAsync(); - } - else - Methods.MainPage.GoToVideo(videoId, playlistId); + private void ViewChannel_Click(object sender, RoutedEventArgs e) + { + Methods.MainPage.GoToChannel(item.Snippet.ChannelId); + } + + private void GetLink_Click(object sender, RoutedEventArgs e) + { + DataPackage data = new DataPackage(); + data.SetText($"https://www.youtube.com/watch?v={videoId}"); + Clipboard.SetContent(data); + } + + private async void InBrowser_Click(object sender, RoutedEventArgs e) + { + await Launcher.LaunchUriAsync($"https://www.youtube.com/watch?v={videoId}".ToUri()); } } } diff --git a/FoxTube/Controls/VideoPlayer.xaml b/FoxTube/Controls/VideoPlayer.xaml index 0a9a56f..a8bd086 100644 --- a/FoxTube/Controls/VideoPlayer.xaml +++ b/FoxTube/Controls/VideoPlayer.xaml @@ -2,10 +2,8 @@ x:Class="FoxTube.VideoPlayer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:FoxTube" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" xmlns:controls1="using:FoxTube.Controls" mc:Ignorable="d" d:DesignHeight="1080" @@ -16,10 +14,9 @@ PointerEntered="UserControl_PointerEntered"> - - - - + + + @@ -27,21 +24,37 @@ - + - - + - + + @@ -53,27 +66,43 @@ + - + - @@ -81,53 +110,102 @@ - + + + - - - + + + - + - + + - - - @@ -168,13 +246,5 @@ - @@ -55,7 +47,7 @@ - @@ -82,38 +74,19 @@ - - - - - - - - - - - - - - - - - - - - + - + - + @@ -154,14 +127,14 @@ - - - + + + - + @@ -169,10 +142,10 @@ - + - + diff --git a/FoxTube/Pages/VideoPage.xaml.cs b/FoxTube/Pages/VideoPage.xaml.cs index 36f4765..420519a 100644 --- a/FoxTube/Pages/VideoPage.xaml.cs +++ b/FoxTube/Pages/VideoPage.xaml.cs @@ -1,22 +1,25 @@ -using System; +using FoxTube.Controls; +using FoxTube.Controls.Adverts; +using Google.Apis.YouTube.v3; +using Google.Apis.YouTube.v3.Data; +using System; using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; using System.Linq; +using Windows.ApplicationModel.DataTransfer; +using Windows.ApplicationModel.Resources; using Windows.Foundation; +using Windows.Storage; +using Windows.System; +using Windows.UI; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; -using Windows.System; -using Google.Apis.YouTube.v3.Data; -using Google.Apis.YouTube.v3; using Windows.UI.Xaml.Media.Imaging; -using System.Diagnostics; -using Windows.ApplicationModel.DataTransfer; -using Windows.Storage; -using Windows.UI; -using FoxTube.Controls; -using YoutubeExplode.Models.MediaStreams; +using Windows.UI.Xaml.Navigation; using YoutubeExplode; +using YoutubeExplode.Models.MediaStreams; namespace FoxTube.Pages { @@ -42,10 +45,10 @@ namespace FoxTube.Pages /// public sealed partial class VideoPage : Page { - ApplicationDataContainer settings = ApplicationData.Current.LocalSettings; + ResourceLoader resources = ResourceLoader.GetForCurrentView("VideoPage"); public string videoId; - string playlistId = null; + public string playlistId = null; public Video item; bool wide; @@ -57,6 +60,8 @@ namespace FoxTube.Pages public CommentsPage comments; public LoadingPage loading; + DispatcherTimer liveTimer; + public VideoPage() { InitializeComponent(); @@ -84,9 +89,12 @@ namespace FoxTube.Pages } } - private void Player_NextClicked(object sender, params object[] e) + private void Player_NextClicked() { - (relatedVideos.Children[0] as VideoCard).Button_Click(this, null); + if (playlistId != null) + playlistList.SelectedIndex++; + else + (relatedVideos.Children[0] as VideoCard).Button_Click(this, null); } protected override void OnNavigatedTo(NavigationEventArgs e) @@ -107,123 +115,20 @@ namespace FoxTube.Pages videoId = ids[0]; if (ids[1] != null) - { - playlistId = ids[1]; - List items = new List(); - VideoPlaylistItem selection = null; - - PlaylistsResource.ListRequest playlistRequest = SecretsVault.Service.Playlists.List("snippet,contentDetails"); - playlistRequest.Id = ids[1]; - Playlist playlistItem = (await playlistRequest.ExecuteAsync()).Items[0]; - - playlistName.Text = playlistItem.Snippet.Title; - playlistChannel.Text = playlistItem.Snippet.ChannelTitle; - - PlaylistItemsResource.ListRequest listRequest = SecretsVault.Service.PlaylistItems.List("snippet"); - listRequest.MaxResults = 50; - listRequest.PlaylistId = ids[1]; - PlaylistItemListResponse listResponse = await listRequest.ExecuteAsync(); - - foreach (PlaylistItem i in listResponse.Items) - { - items.Add(new VideoPlaylistItem(i.Snippet.Thumbnails.Medium.Url, i.Snippet.Title, i.Snippet.ResourceId.VideoId)); - if (items.Last().Id == videoId) - selection = items.Last(); - } - - string token = listResponse.NextPageToken; - while(!string.IsNullOrWhiteSpace(token)) - { - listRequest.PageToken = token; - listResponse = await listRequest.ExecuteAsync(); - - foreach (PlaylistItem i in listResponse.Items) - { - items.Add(new VideoPlaylistItem(i.Snippet.Thumbnails.Medium.Url, i.Snippet.Title, i.Snippet.ResourceId.VideoId)); - if (items.Last().Id == videoId) - selection = items.Last(); - } - - token = listResponse.NextPageToken; - } - - for (int k = 0; k < items.Count; k++) - items[k].Number = k + 1; - - playlistCounter.Text = $"{items.IndexOf(selection) + 1}/{playlistItem.ContentDetails.ItemCount}"; - - playlistList.ItemsSource = items; - playlistList.SelectedItem = selection; - pivot.SelectedItem = playlist; - } + LoadPlaylist(ids[1]); else pivot.Items.Remove(playlist); - VideosResource.ListRequest request = SecretsVault.Service.Videos.List("snippet,statistics,status,contentDetails"); + VideosResource.ListRequest request = SecretsVault.Service.Videos.List("snippet,statistics,status,contentDetails,liveStreamingDetails"); request.Id = ids[0]; item = (await request.ExecuteAsync()).Items[0]; - title.Text = item.Snippet.Title; - Methods.FormatText(ref description, item.Snippet.Description); - - publishedAt.Text = item.Snippet.PublishedAt.ToString(); - if (item.Status.License == "youtube") - license.Text = "Standard YouTube License"; - else license.Text = "Creative Commons Attribution license (reuse allowed)"; - - VideoCategoriesResource.ListRequest categoryRequest = SecretsVault.Service.VideoCategories.List("snippet"); - categoryRequest.Id = item.Snippet.CategoryId; - category.Text = (await categoryRequest.ExecuteAsync()).Items[0].Snippet.Title; - - views.Text = $"{item.Statistics.ViewCount:0,0} views"; - dislikes.Text = $"{item.Statistics.DislikeCount:0,0}"; - likes.Text = $"{item.Statistics.LikeCount:0,0}"; - rating.Value = (double)item.Statistics.DislikeCount / (double)(item.Statistics.DislikeCount + item.Statistics.LikeCount) * 100; - - if (SecretsVault.IsAuthorized) - { - VideoGetRatingResponse ratingResponse = await SecretsVault.Service.Videos.GetRating(ids[0]).ExecuteAsync(); - if (ratingResponse.Items[0].Rating == "like") - { - userRating = Rating.Like; - like.Foreground = new SolidColorBrush(Colors.Green); - } - else if (ratingResponse.Items[0].Rating == "dislike") - { - userRating = Rating.Dislike; - dislike.Foreground = new SolidColorBrush(Colors.Red); - } - - foreach (Subscription s in SecretsVault.Subscriptions) - { - if (s.Snippet.ResourceId.ChannelId == item.Snippet.ChannelId) - { - subscribe.Background = new SolidColorBrush(Colors.Transparent); - subscribe.Foreground = new SolidColorBrush(Colors.Gray); - subscribe.Content = "Subscribed"; - } - } - subscribe.Visibility = Visibility.Visible; - } + if (item.Snippet.LiveBroadcastContent == "none") + LoadStats(); else - { - download.Visibility = Visibility.Collapsed; - addTo.Visibility = Visibility.Collapsed; - subscribe.Visibility = Visibility.Collapsed; - } + LoadStream(); - ChannelsResource.ListRequest channelRequest = SecretsVault.Service.Channels.List("snippet, statistics"); - channelRequest.Id = item.Snippet.ChannelId; - var item1 = (await channelRequest.ExecuteAsync()).Items[0]; - - channelAvatar.ProfilePicture = new BitmapImage(new Uri(item1.Snippet.Thumbnails.Medium.Url)); - channelName.Text = item.Snippet.ChannelTitle; - subscribers.Text = $"{item1.Statistics.SubscriberCount:0,0} subscribers"; - - comments.Initialize(item); - player.Initialize(item, item1.Snippet.Thumbnails.Medium.Url); - LoadRelatedVideos(); - LoadDownloads(); + LoadInfo(); loading.Close(); } @@ -237,6 +142,161 @@ namespace FoxTube.Pages } } + async void LoadPlaylist(string id) + { + playlistId = id; + List items = new List(); + VideoPlaylistItem selection = null; + + //Retrieving data + PlaylistsResource.ListRequest playlistRequest = SecretsVault.Service.Playlists.List("snippet,contentDetails"); + playlistRequest.Id = id; + Playlist playlistItem = (await playlistRequest.ExecuteAsync()).Items[0]; + + PlaylistItemsResource.ListRequest listRequest = SecretsVault.Service.PlaylistItems.List("snippet"); + listRequest.MaxResults = 50; + listRequest.PlaylistId = id; + PlaylistItemListResponse listResponse = await listRequest.ExecuteAsync(); + + foreach (PlaylistItem i in listResponse.Items) + { + items.Add(new VideoPlaylistItem(i.Snippet.Thumbnails.Medium.Url, i.Snippet.Title, i.Snippet.ResourceId.VideoId)); + if (items.Last().Id == videoId) + selection = items.Last(); + } + + string token = listResponse.NextPageToken; + while (!string.IsNullOrWhiteSpace(token)) + { + listRequest.PageToken = token; + listResponse = await listRequest.ExecuteAsync(); + + foreach (PlaylistItem i in listResponse.Items) + { + items.Add(new VideoPlaylistItem(i.Snippet.Thumbnails.Medium.Url, i.Snippet.Title, i.Snippet.ResourceId.VideoId)); + if (items.Last().Id == videoId) + selection = items.Last(); + } + + token = listResponse.NextPageToken; + } + + for (int k = 0; k < items.Count; k++) + items[k].Number = k + 1; + + //Setting data + playlistName.Text = playlistItem.Snippet.Title; + playlistChannel.Text = playlistItem.Snippet.ChannelTitle; + + playlistCounter.Text = $"{items.IndexOf(selection) + 1}/{playlistItem.ContentDetails.ItemCount}"; + + playlistList.ItemsSource = items; + playlistList.SelectedItem = selection; + pivot.SelectedItem = playlist; + + if (playlistList.SelectedIndex == playlistList.Items.Count - 1) + player.Next.Visibility = Visibility.Collapsed; + } + + async void LoadInfo() + { + //Setting meta + title.Text = item.Snippet.Title; + Methods.FormatText(ref description, item.Snippet.Description); + + //Setting channel button + ChannelsResource.ListRequest channelRequest = SecretsVault.Service.Channels.List("snippet, statistics"); + channelRequest.Id = item.Snippet.ChannelId; + var item1 = (await channelRequest.ExecuteAsync()).Items[0]; + + channelAvatar.ProfilePicture = new BitmapImage(new Uri(item1.Snippet.Thumbnails.Medium.Url)); + channelName.Text = item.Snippet.ChannelTitle; + subscribers.Text = $"{item1.Statistics.SubscriberCount:0,0} {resources.GetString("/Cards/subscribers")}"; + + //Setting ratings + dislikes.Text = $"{item.Statistics.DislikeCount:0,0}"; + likes.Text = $"{item.Statistics.LikeCount:0,0}"; + rating.Value = (double)item.Statistics.DislikeCount / (double)(item.Statistics.DislikeCount + item.Statistics.LikeCount) * 100; + + //Setting category + VideoCategoriesResource.ListRequest categoryRequest = SecretsVault.Service.VideoCategories.List("snippet"); + categoryRequest.Id = item.Snippet.CategoryId; + category.Text = (await categoryRequest.ExecuteAsync()).Items[0].Snippet.Title; + + //Setting User's rate + if (SecretsVault.IsAuthorized) + { + VideoGetRatingResponse ratingResponse = await SecretsVault.Service.Videos.GetRating(videoId).ExecuteAsync(); + if (ratingResponse.Items[0].Rating == "like") + { + userRating = Rating.Like; + like.Foreground = new SolidColorBrush(Colors.Green); + } + else if (ratingResponse.Items[0].Rating == "dislike") + { + userRating = Rating.Dislike; + dislike.Foreground = new SolidColorBrush(Colors.Red); + } + + foreach (Subscription s in SecretsVault.Subscriptions) + { + if (s.Snippet.ResourceId.ChannelId == item.Snippet.ChannelId) + { + subscribe.Background = new SolidColorBrush(Colors.Transparent); + subscribe.Foreground = new SolidColorBrush(Colors.Gray); + subscribe.Content = resources.GetString("/Cards/unsubscribe"); + } + } + subscribe.Visibility = Visibility.Visible; + } + else + { + download.Visibility = Visibility.Collapsed; + addTo.Visibility = Visibility.Collapsed; + subscribe.Visibility = Visibility.Collapsed; + } + + //Initializing player + player.Initialize(item, item1.Snippet.Thumbnails.Medium.Url); + + LoadRelatedVideos(); + } + + void LoadStream() + { + liveTimer = new DispatcherTimer() { Interval = TimeSpan.FromSeconds(10) }; + liveTimer.Tick += LiveStatsUpdate; + liveTimer.Start(); + LiveStatsUpdate(); + + if(string.IsNullOrWhiteSpace(item.LiveStreamingDetails.ActiveLiveChatId)) + pivot.Items.Remove(commentsPlaceholder); + else + { + commentsPlaceholder.Header = resources.GetString("/VideoPage/chat"); + commentsPlaceholder.Content = new Chat(item.LiveStreamingDetails.ActiveLiveChatId); + pivot.SelectedItem = commentsPlaceholder; + } + download.Visibility = Visibility.Collapsed; + } + + private async void LiveStatsUpdate(object sender = null, object e = null) + { + VideosResource.ListRequest request = SecretsVault.Service.Videos.List("liveStreamingDetails"); + request.Id = videoId; + Video video = (await request.ExecuteAsync()).Items[0]; + + views.Text = $"{video.LiveStreamingDetails.ConcurrentViewers} {resources.GetString("/Cards/viewers")}"; + } + + void LoadStats() + { + views.Text = $"{item.Statistics.ViewCount:0,0} {resources.GetString("/Cards/views")}"; + + comments.Initialize(item); + LoadDownloads(); + } + async void LoadDownloads() { try @@ -255,8 +315,8 @@ namespace FoxTube.Pages MenuFlyoutItem audioItem = new MenuFlyoutItem() { - Text = "Audio track", - Tag = new object[] { infoSet.Audio[0], "Audio only" } + Text = resources.GetString("/VideoPage/audio"), + Tag = new object[] { infoSet.Audio[0], resources.GetString("/Cards/audioOnly") } }; audioItem.Click += downloadItemSelected; downloadSelector.Items.Add(audioItem); @@ -275,8 +335,10 @@ namespace FoxTube.Pages async void LoadRelatedVideos() { SearchResource.ListRequest request = SecretsVault.Service.Search.List("snippet"); + request.RegionCode = SettingsStorage.Region; + request.RelevanceLanguage = SettingsStorage.RelevanceLanguage; request.RelatedToVideoId = videoId; - request.SafeSearch = (SearchResource.ListRequest.SafeSearchEnum)(int)settings.Values["safeSearch"]; + request.SafeSearch = (SearchResource.ListRequest.SafeSearchEnum)SettingsStorage.SafeSearch; request.MaxResults = 20; request.Type = "video"; @@ -320,10 +382,10 @@ namespace FoxTube.Pages private async void openBrowser_Click(object sender, RoutedEventArgs e) { player.Pause(); - string timecode = player.elapsed.TotalSeconds > 10 ? - "&t=" + (int)player.elapsed.TotalSeconds + "s" : string.Empty; + string timecode = player.Elapsed.TotalSeconds > 10 ? + "&t=" + (int)player.Elapsed.TotalSeconds + "s" : string.Empty; - await Launcher.LaunchUriAsync(new Uri($"https://www.youtube.com/watch?v={videoId}{timecode}")); + await Launcher.LaunchUriAsync($"https://www.youtube.com/watch?v={videoId}{timecode}".ToUri()); } public void refresh_Click(object sender, RoutedEventArgs e) @@ -344,6 +406,8 @@ namespace FoxTube.Pages mainContent.Children.Remove(pivot); tabsPlaceholder.Children.Add(pivot); + pivot.SelectedItem = descriptionPanel; + descriptionPanel.Opacity = 1; pivot.Items.RemoveAt(0); mainContent.Children.Add(descriptionPanel); @@ -373,7 +437,7 @@ namespace FoxTube.Pages item.Snippet.Thumbnails.Medium.Url, item.Snippet.Title, $"https://www.youtube.com/watch?v={videoId}", - "video"); + resources.GetString("/Cards/videoShare")); } private void share_Click(object sender, RoutedEventArgs e) @@ -388,10 +452,10 @@ namespace FoxTube.Pages { case Rating.Like: like.Foreground = new SolidColorBrush(Colors.Gray); - likes.Text = (int.Parse(likes.Text, System.Globalization.NumberStyles.AllowThousands) - 1).ToString("0,0"); + likes.Text = (int.Parse(likes.Text, NumberStyles.AllowThousands) - 1).ToString("0,0"); dislike.Foreground = new SolidColorBrush(Colors.Red); - dislikes.Text = (int.Parse(dislikes.Text, System.Globalization.NumberStyles.AllowThousands) + 1).ToString("0,0"); + dislikes.Text = (int.Parse(dislikes.Text, NumberStyles.AllowThousands) + 1).ToString("0,0"); rating.Value--; await SecretsVault.Service.Videos.Rate(videoId, VideosResource.RateRequest.RatingEnum.Dislike).ExecuteAsync(); @@ -400,7 +464,7 @@ namespace FoxTube.Pages case Rating.None: dislike.Foreground = new SolidColorBrush(Colors.Red); - dislikes.Text = (int.Parse(dislikes.Text, System.Globalization.NumberStyles.AllowThousands) + 1).ToString("0,0"); + dislikes.Text = (int.Parse(dislikes.Text, NumberStyles.AllowThousands) + 1).ToString("0,0"); rating.Maximum++; await SecretsVault.Service.Videos.Rate(videoId, VideosResource.RateRequest.RatingEnum.Dislike).ExecuteAsync(); @@ -409,7 +473,7 @@ namespace FoxTube.Pages case Rating.Dislike: dislike.Foreground = new SolidColorBrush(Colors.Gray); - dislikes.Text = (int.Parse(dislikes.Text, System.Globalization.NumberStyles.AllowThousands) - 1).ToString("0,0"); + dislikes.Text = (int.Parse(dislikes.Text, NumberStyles.AllowThousands) - 1).ToString("0,0"); rating.Maximum--; await SecretsVault.Service.Videos.Rate(videoId, VideosResource.RateRequest.RatingEnum.None).ExecuteAsync(); break; @@ -423,10 +487,10 @@ namespace FoxTube.Pages { case Rating.Dislike: dislike.Foreground = new SolidColorBrush(Colors.Gray); - dislikes.Text = (int.Parse(dislikes.Text, System.Globalization.NumberStyles.AllowThousands) - 1).ToString("0,0"); + dislikes.Text = (int.Parse(dislikes.Text, NumberStyles.AllowThousands) - 1).ToString("0,0"); like.Foreground = new SolidColorBrush(Colors.Green); - likes.Text = (int.Parse(likes.Text, System.Globalization.NumberStyles.AllowThousands) + 1).ToString("0,0"); + likes.Text = (int.Parse(likes.Text, NumberStyles.AllowThousands) + 1).ToString("0,0"); rating.Value++; await SecretsVault.Service.Videos.Rate(videoId, VideosResource.RateRequest.RatingEnum.Like).ExecuteAsync(); @@ -435,7 +499,7 @@ namespace FoxTube.Pages case Rating.None: like.Foreground = new SolidColorBrush(Colors.Green); - likes.Text = (int.Parse(likes.Text, System.Globalization.NumberStyles.AllowThousands) + 1).ToString("0,0"); + likes.Text = (int.Parse(likes.Text, NumberStyles.AllowThousands) + 1).ToString("0,0"); rating.Maximum++; rating.Value++; await SecretsVault.Service.Videos.Rate(videoId, VideosResource.RateRequest.RatingEnum.Like).ExecuteAsync(); @@ -445,7 +509,7 @@ namespace FoxTube.Pages case Rating.Like: like.Foreground = new SolidColorBrush(Colors.Gray); - likes.Text = (int.Parse(likes.Text, System.Globalization.NumberStyles.AllowThousands) - 1).ToString("0,0"); + likes.Text = (int.Parse(likes.Text, NumberStyles.AllowThousands) - 1).ToString("0,0"); rating.Maximum--; rating.Value--; await SecretsVault.Service.Videos.Rate(videoId, VideosResource.RateRequest.RatingEnum.None).ExecuteAsync(); @@ -469,13 +533,13 @@ namespace FoxTube.Pages { subscribe.Background = new SolidColorBrush(Colors.Transparent); subscribe.Foreground = new SolidColorBrush(Colors.Gray); - subscribe.Content = "Subscribed"; + subscribe.Content = resources.GetString("/Cards/unsubscribe"); } else { subscribe.Background = new SolidColorBrush(Colors.Red); subscribe.Foreground = new SolidColorBrush(Colors.White); - subscribe.Content = "Subscribe"; + subscribe.Content = resources.GetString("/Cards/subscribe/Content"); } } } diff --git a/FoxTube/Strings/en-US/Cards.resw b/FoxTube/Strings/en-US/Cards.resw new file mode 100644 index 0000000..ab86fa0 --- /dev/null +++ b/FoxTube/Strings/en-US/Cards.resw @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + View channel + + + channel + + + Copy link + + + Goes live in + + + Play incognito + + + LIVE + + + Log in + + + Show more + + + Open in browser + + + Play + + + View playlist + + + playlist + + + Share + + + Subscribe + + + subscribers + + + to manage your subscriptions + + + Subscribed + + + Upcoming + + + videos + + + video + + + viewers + + + views + + + Watched + + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/Channel.resw b/FoxTube/Strings/en-US/Channel.resw new file mode 100644 index 0000000..8bf1e13 --- /dev/null +++ b/FoxTube/Strings/en-US/Channel.resw @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + About channel + + + About this channel + + + Description + + + Open in browser + + + Playlists + + + Playlists + + + Refresh + + + Registration date: + + + Search on channel + + + Share + + + Statistics + + + Videos + + + Views: + + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/Translate.resw b/FoxTube/Strings/en-US/Chat.resw similarity index 84% rename from FoxTube/Strings/en-US/Translate.resw rename to FoxTube/Strings/en-US/Chat.resw index 11000f9..c617ede 100644 --- a/FoxTube/Strings/en-US/Translate.resw +++ b/FoxTube/Strings/en-US/Chat.resw @@ -117,28 +117,22 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - You can help us make this app even better by contributing to its development by translating this app. You can choose a brand new language to translate or edit mistakes in existing translations. + + Send a message - - Export to PC (.zip) + + Moderator - - It's quite simple: + + Chat owner - - 1. Choose language you you want to translate on + + Sponsor - - 2. Import language pack to your PC + + Verified - - Help us translate this app - - - Choose language... - - - Attention! This tool is used to help us to provide our app to more people from other countries. Please, don't send not done language packs. Thanks in advance ;) + + Welcome to the chat room \ No newline at end of file diff --git a/FoxTube/Strings/en-US/CommentsPage.resw b/FoxTube/Strings/en-US/CommentsPage.resw index 2032004..e7e6243 100644 --- a/FoxTube/Strings/en-US/CommentsPage.resw +++ b/FoxTube/Strings/en-US/CommentsPage.resw @@ -117,19 +117,64 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + comments + Date + + Are you sure? This action cannot be undone + + + Delete comment + + + Edit + + + (edited) + + + Cancel + + + Delete comment + + + Submit + + + Failed to edit your commentary. Please, try again later. + + + Failed to send your reply. Please, try again later. + Show more + + No + + + Publish date + Relevance + + Reply + + + Enter your reply... + Sort by: Add a public comment + + Yes + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/Downloads.resw b/FoxTube/Strings/en-US/Downloads.resw new file mode 100644 index 0000000..375962e --- /dev/null +++ b/FoxTube/Strings/en-US/Downloads.resw @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Author + + + Cancel + + + Cancelling... + + + Cancelling download + + + Downloading... + + + Duration + + + Extension + + + Go to original + + + No + + + You haven't downloaded anything yet + + + Open + + + Open folder + + + Are you sure? + + + Quality + + + Refresh + + + Download canceled + + + Download complete + + + Downloading a video + + + Yes + + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/General.resw b/FoxTube/Strings/en-US/General.resw index f25ee73..a60bc4f 100644 --- a/FoxTube/Strings/en-US/General.resw +++ b/FoxTube/Strings/en-US/General.resw @@ -198,4 +198,10 @@ Close app + + Recieve messages from developers + + + Recieve messages from developers + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/Home.resw b/FoxTube/Strings/en-US/Home.resw new file mode 100644 index 0000000..5c45bac --- /dev/null +++ b/FoxTube/Strings/en-US/Home.resw @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Recommended + + + Refresh page + + + Subscriptions + + + Trending + + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/Inbox.resw b/FoxTube/Strings/en-US/Inbox.resw index f7766ac..242796a 100644 --- a/FoxTube/Strings/en-US/Inbox.resw +++ b/FoxTube/Strings/en-US/Inbox.resw @@ -120,9 +120,15 @@ All + + Changelog + Changelogs + + Developer's message + Filter @@ -132,4 +138,7 @@ Select item from the list + + What's new in v + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/LoadingPage.resw b/FoxTube/Strings/en-US/LoadingPage.resw index 77fc835..7cd1265 100644 --- a/FoxTube/Strings/en-US/LoadingPage.resw +++ b/FoxTube/Strings/en-US/LoadingPage.resw @@ -117,37 +117,37 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + Check your internet connection - Message: + Details - + We are unable to display the page - + It could be caused by YouTube internal server error or by application's bug. Please, try again later - Exception: + Exception - + Report problem - + Open troubleshooter - + Open network settings - + OR - + Refresh page - + Please, make sure you are connected to the internet and try again. \ No newline at end of file diff --git a/FoxTube/Strings/en-US/Main.resw b/FoxTube/Strings/en-US/Main.resw index ba22dcd..a53def0 100644 --- a/FoxTube/Strings/en-US/Main.resw +++ b/FoxTube/Strings/en-US/Main.resw @@ -117,9 +117,21 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Add to 'Watch later' playlist + Remove ads + + Channel + + + We were unabled to retrieve your account information due to weak internet connection or Google servers' problems. PLease, try again later + + + Failed to connect + Downloads @@ -138,8 +150,8 @@ Liked videos - - My account + + You are on metered connection now. Additional charges may apply. Do you want to continue? My channel @@ -150,8 +162,14 @@ My library - - Notifications + + No + + + Playlist + + + Quit Search @@ -162,8 +180,8 @@ Sign in with existing account - - Sign in + + Add account Create new Google account @@ -174,4 +192,13 @@ Subscriptions + + Try again + + + Video + + + Yes + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/Methods.resw b/FoxTube/Strings/en-US/Methods.resw new file mode 100644 index 0000000..f73f43b --- /dev/null +++ b/FoxTube/Strings/en-US/Methods.resw @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + days ago + + + hours ago + + + minutes ago + + + months ago + + + Just now + + + 1 day ago + + + 1 hour ago + + + 1 minute ago + + + 1 month ago + + + 1 week ago + + + 1 year ago + + + Sharing a + + + weeks ago + + + years ago + + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/Playlist.resw b/FoxTube/Strings/en-US/Playlist.resw new file mode 100644 index 0000000..9b515a3 --- /dev/null +++ b/FoxTube/Strings/en-US/Playlist.resw @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add to + + + Open in browser + + + Refresh + + + Share + + + videos + + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/Search.resw b/FoxTube/Strings/en-US/Search.resw new file mode 100644 index 0000000..36c2fa0 --- /dev/null +++ b/FoxTube/Strings/en-US/Search.resw @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + All + + + Any + + + Anytime + + + Apply + + + Creative Commons + + + Channel + + + Duration + + + Features + + + Features + + + Show filters  + + + Found + + + Search results for: + + + Hide filters  + + + item(s) + + + Last hour + + + Live + + + Long (> 20 minutes) + + + Medium + + + This month + + + Open in browser + + + Sort by + + + Playlist + + + Rating + + + Refresh + + + Relevance + + + Short (< 4 minutes) + + + Subtitles/CC + + + Title + + + Today + + + Type + + + Upload date + + + Upload date + + + Video + + + View count + + + This week + + + This year + + \ No newline at end of file diff --git a/FoxTube/Strings/en-US/VideoPage.resw b/FoxTube/Strings/en-US/VideoPage.resw new file mode 100644 index 0000000..bf046a2 --- /dev/null +++ b/FoxTube/Strings/en-US/VideoPage.resw @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add to + + + Audio track + + + Audio only + + + Go back for 10 seconds + + + Cast to device + + + Chat + + + Close video + + + Comments + + + Description + + + Download video + + + Exit compact view mode + + + Full screen + + + Skip forward for 30 seconds + + + Go to live broadcast + + + Maximize + + + Minimize + + + Compact view mode + + + Mute + + + Next video + + + Open in browser + + + Play / Pause + + + Playlist + + + Video quality + + + Quality + + + Refresh page + + + Suggestons + + + Share + + + Elapsed time since stream start + + + Captions + + + No captions are available + + + Captions + + + Captions + + + Volume + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Cards.resw b/FoxTube/Strings/ru-RU/Cards.resw new file mode 100644 index 0000000..4f0137a --- /dev/null +++ b/FoxTube/Strings/ru-RU/Cards.resw @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Посмотреть канал + + + каналом + + + Скопировать ссылку + + + Начало через + + + Открыть в режиме инкогнито + + + Прямой эфир + + + Войдите + + + Показать еще + + + Открыть в браузере + + + Открыть + + + Посмотреть плейлист + + + плейлистом + + + Поделиться + + + Подписаться + + + подписчиков + + + чтобы управлять подписками + + + Вы подписаны + + + Запланирован + + + видео + + + видео + + + зрителей + + + просмотров + + + Просмотрено + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Channel.resw b/FoxTube/Strings/ru-RU/Channel.resw new file mode 100644 index 0000000..0eabc5a --- /dev/null +++ b/FoxTube/Strings/ru-RU/Channel.resw @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + О канале + + + Об этом канале + + + Описание + + + Открыть в браузере + + + Плейлисты + + + Плейлисты + + + Обновить + + + Дата регистрации: + + + Искать на канале + + + Поделиться + + + Статистика + + + Видео + + + Просмотры: + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Chat.resw b/FoxTube/Strings/ru-RU/Chat.resw new file mode 100644 index 0000000..b2d460f --- /dev/null +++ b/FoxTube/Strings/ru-RU/Chat.resw @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Отправить сообщение + + + Модератор + + + Владелец чата + + + Спонсор + + + Подтвержден + + + Добро пожаловать в чат! + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/CommentsPage.resw b/FoxTube/Strings/ru-RU/CommentsPage.resw new file mode 100644 index 0000000..51dc3ef --- /dev/null +++ b/FoxTube/Strings/ru-RU/CommentsPage.resw @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + комментариев + + + Дате + + + Вы уверены? Это действие нельзя отменить + + + Удалить комментарий + + + Редактировать + + + (изменен) + + + Отмена + + + Удалить комментарий + + + Отправить + + + Не удалось изменить комментарий. Пожалуйста, попробуйте позже + + + Не удалось отправить ответ. Пожалуйста, попробуйте позже + + + Показать еще + + + Нет + + + Дате публикации + + + Популярности + + + Ответить + + + Введите свой ответ... + + + Сортировать по: + + + Оставить комментарий + + + Да + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Downloads.resw b/FoxTube/Strings/ru-RU/Downloads.resw new file mode 100644 index 0000000..9efd987 --- /dev/null +++ b/FoxTube/Strings/ru-RU/Downloads.resw @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Автор + + + Отмена + + + Отмена... + + + Отмена загрузки + + + Загрузка... + + + Длительность + + + Расширение + + + Открыть оригинал + + + Нет + + + Вы еще ничего не скачивали + + + Открыть + + + Открыть папку + + + Вы уверены? + + + Качество + + + Обновить + + + Загрузка отменена + + + Загрузка завершена + + + Загрузка видео + + + Да + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/General.resw b/FoxTube/Strings/ru-RU/General.resw index 2582bc1..fcac5fb 100644 --- a/FoxTube/Strings/ru-RU/General.resw +++ b/FoxTube/Strings/ru-RU/General.resw @@ -198,4 +198,10 @@ Закрыть приложение + + Получать уведомления от разработчиков + + + Получать уведомления от разработчиков + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Home.resw b/FoxTube/Strings/ru-RU/Home.resw new file mode 100644 index 0000000..91991ed --- /dev/null +++ b/FoxTube/Strings/ru-RU/Home.resw @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Рекомендуемое + + + Обновить страницу + + + Подписки + + + Популярное + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Inbox.resw b/FoxTube/Strings/ru-RU/Inbox.resw index da979b1..1ad2876 100644 --- a/FoxTube/Strings/ru-RU/Inbox.resw +++ b/FoxTube/Strings/ru-RU/Inbox.resw @@ -120,9 +120,15 @@ Все + + Список изменений + "Что нового?" + + Сообщение от разработчиков + Фильтр @@ -132,4 +138,7 @@ Выберите сообщение из списка + + Что нового в версии + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/LoadingPage.resw b/FoxTube/Strings/ru-RU/LoadingPage.resw index 119f4a1..f4b0f69 100644 --- a/FoxTube/Strings/ru-RU/LoadingPage.resw +++ b/FoxTube/Strings/ru-RU/LoadingPage.resw @@ -117,37 +117,37 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + Проверте интернет-соединение - Сообщение: + Сообщение - + Мы не можем отобразить страницу - + Это может происходить из-за проблем на серверах YouTube или из-за ошибок приложения. Пожалуйста, попробуйте позже - Ошибка: + Ошибка - + Сообщить об ошибке - + Устранение неполадок - + Открыть настройки сети - + ИЛИ - + Обновить страницу - + Пожалуйста, убедитесь, что вы подключены к Интернету и попробуйте обновить страницу \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Main.resw b/FoxTube/Strings/ru-RU/Main.resw index 5d461a8..a7638c5 100644 --- a/FoxTube/Strings/ru-RU/Main.resw +++ b/FoxTube/Strings/ru-RU/Main.resw @@ -117,9 +117,21 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Добавить в плейлист 'Посмотреть позже' + Убрать рекламу + + Канал + + + Нам не удалось подключиться к серверу из-за плохого соединения или проблем на стороне YouTube. Пожалуйста, попробуйте позже + + + Не удалось подключиться + Загрузки @@ -138,8 +150,8 @@ Понравившиеся - - Мой аккаунт + + Передача данных в этой сети ограничена. Может взиматься дополнительная плата. Вы хотите продолжить? Мой канал @@ -150,8 +162,14 @@ Библиотека - - Уведомления + + Нет + + + Плейлист + + + Выйти Поиск @@ -162,8 +180,8 @@ Войти с помощью существующего аккаунта Google - - Войти + + Войти в аккаунт Создать новый аккаунт Google @@ -174,4 +192,13 @@ Подписки + + Попробовать снова + + + Видео + + + Да + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Methods.resw b/FoxTube/Strings/ru-RU/Methods.resw new file mode 100644 index 0000000..a00cf5a --- /dev/null +++ b/FoxTube/Strings/ru-RU/Methods.resw @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + дней назад + + + часов назад + + + минут назад + + + месяцев назад + + + Только что + + + 1 день назад + + + 1 час назад + + + 1 минуту назад + + + 1 месяц назад + + + 1 неделю назад + + + 1 год назад + + + Поделиться + + + недель назад + + + лет назад + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Playlist.resw b/FoxTube/Strings/ru-RU/Playlist.resw new file mode 100644 index 0000000..054ca36 --- /dev/null +++ b/FoxTube/Strings/ru-RU/Playlist.resw @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Добавить в + + + Открыть в браузере + + + Обновить + + + Поделиться + + + видео + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/Search.resw b/FoxTube/Strings/ru-RU/Search.resw new file mode 100644 index 0000000..b2d2794 --- /dev/null +++ b/FoxTube/Strings/ru-RU/Search.resw @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Все + + + Любая + + + Любое + + + Применить + + + Лицензия Creative Commons + + + Канал + + + Длительность + + + Особенности + + + Особенности + + + Показать фильтры  + + + Найдено + + + Результаты поиска по запросу + + + Скрыть фильтры  + + + результатов + + + За последний час + + + Прямой эфир + + + Большая (> 20 минут) + + + Средняя + + + За этот месяц + + + Открыть в браузере + + + Сортировать по + + + Плейлист + + + Рейтингу + + + Обновить + + + Популярности + + + Короткая (< 4 минут) + + + Субтитры + + + Названию + + + Сегодня + + + Тип + + + Дате публикации + + + Дата публикации + + + Видео + + + Количеству просмотров + + + За эту неделю + + + За этот год + + \ No newline at end of file diff --git a/FoxTube/Strings/ru-RU/VideoPage.resw b/FoxTube/Strings/ru-RU/VideoPage.resw new file mode 100644 index 0000000..b862e69 --- /dev/null +++ b/FoxTube/Strings/ru-RU/VideoPage.resw @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Добавить в + + + Аудио дорожка + + + Аудио дорожка + + + Назад на 10 секунд + + + Отправить на устройство + + + Чат + + + Закрыть видео + + + Комментарии + + + Описание + + + Скачать видео + + + Развернуть + + + Полный экран + + + Вперед на 30 секунд + + + Перейти к прямому эфиру + + + Развернуть + + + Свернуть + + + Картинка в картинке + + + Выключить звук + + + Следующее видео + + + Открыть в браузере + + + Воспроизвести / Пауза + + + Плейлист + + + Качество видео + + + Качество + + + Обновить страницу + + + Похожее + + + Поделиться + + + Время, прошедшее с начала стрима + + + Субтитры + + + Нет доступных субтитров + + + Субтитры + + + Субтитры + + + Громкость + + \ No newline at end of file diff --git a/Src/LogoVer3.png b/Src/LogoVer3.png new file mode 100644 index 0000000..dfa76d6 Binary files /dev/null and b/Src/LogoVer3.png differ diff --git a/Src/NewLogoDraft.psd b/Src/NewLogoDraft.psd new file mode 100644 index 0000000..3ca3463 Binary files /dev/null and b/Src/NewLogoDraft.psd differ diff --git a/Src/NewLogoDraftVer2.psd b/Src/NewLogoDraftVer2.psd new file mode 100644 index 0000000..dacf7a9 Binary files /dev/null and b/Src/NewLogoDraftVer2.psd differ diff --git a/Src/NewLogoDraftVer3.psd b/Src/NewLogoDraftVer3.psd new file mode 100644 index 0000000..be4c856 Binary files /dev/null and b/Src/NewLogoDraftVer3.psd differ