Archived
1
0

Added Subscriptions page and updated subscriptions management

This commit is contained in:
Michael Gordeev
2020-05-14 23:45:11 +03:00
parent 8159d33a43
commit b3212738e8
12 changed files with 284 additions and 67 deletions
+12 -1
View File
@@ -1,10 +1,12 @@
using FoxTube.Utils;
using Google.Apis.YouTube.v3.Data;
using SQLitePCL;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using Windows.Devices.PointOfService;
using Windows.UI;
@@ -47,7 +49,7 @@ namespace FoxTube
public static string ToHex(this Color color) =>
$"#{color.R:X}{color.G:X}{color.B:X}";
public static Color FromHex(this Color parent, string hex)
public static Color FromHex(string hex)
{
hex = hex.Replace("#", "");
List<byte> values = new List<byte>();
@@ -126,5 +128,14 @@ namespace FoxTube
else
return Math.Round(span.TotalDays / 365) + " " + "years ago";
}
public static async Task<Channel> GetChannel(string channelId, string part)
{
var request = UserManagement.Service.Channels.List(part);
request.Id = channelId;
request.MaxResults = 1;
return (await request.ExecuteAsync()).Items.FirstOrDefault();
}
}
}