#124: Done
This commit is contained in:
@@ -4,6 +4,7 @@ using Google.Apis.YouTube.v3.Data;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using Windows.ApplicationModel.Background;
|
||||
using Windows.Storage;
|
||||
@@ -37,13 +38,11 @@ namespace FoxTube.Background
|
||||
else
|
||||
lastCheck = DateTime.Parse(settings.Values["lastCheck"] as string);
|
||||
|
||||
//ToastNotificationManager.CreateToastNotifier().Show(Notification.GetInternalToast(null, $"{DateTime.Now} Retrieving videos since", lastCheck.ToString(), null, null));
|
||||
|
||||
bool[] notificationsSettings = JsonConvert.DeserializeObject<bool[]>(await FileIO.ReadTextAsync(await ApplicationData.Current.RoamingFolder.GetFileAsync("notifications.json")));
|
||||
if (notificationsSettings[0])
|
||||
CheckAnnouncements();
|
||||
if (notificationsSettings[1])
|
||||
CheckAccount();
|
||||
await CheckAccount();
|
||||
}
|
||||
catch { }
|
||||
finally
|
||||
@@ -53,7 +52,7 @@ namespace FoxTube.Background
|
||||
}
|
||||
}
|
||||
|
||||
async void CheckAccount()
|
||||
async Task CheckAccount()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -61,7 +60,7 @@ namespace FoxTube.Background
|
||||
foreach (var s in subscriptions)
|
||||
{
|
||||
SearchResource.ListRequest request = Service.Search.List("snippet");
|
||||
request.PublishedAfter = lastCheck.Subtract(TimeSpan.FromDays(1));
|
||||
request.PublishedAfter = lastCheck;
|
||||
request.ChannelId = s.Key;
|
||||
request.Type = "video";
|
||||
request.MaxResults = 5;
|
||||
|
||||
Reference in New Issue
Block a user