Added subscriptions management
This commit is contained in:
@@ -27,13 +27,13 @@ namespace FoxTube
|
||||
#region Private members
|
||||
private static readonly ApplicationDataContainer storage = ApplicationData.Current.LocalSettings;
|
||||
|
||||
private static ExtendedYouTubeService _defaultService = new ExtendedYouTubeService(new Google.Apis.Services.BaseClientService.Initializer
|
||||
private static readonly ExtendedYouTubeService _defaultService = new ExtendedYouTubeService(new Google.Apis.Services.BaseClientService.Initializer
|
||||
{
|
||||
ApplicationName = "FoxTube",
|
||||
ApiKey = "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0",
|
||||
//ApiKey = "AIzaSyD7tpbuvmYDv9h4udo9L_g3r0sLPFAnN00"
|
||||
});
|
||||
private static YoutubeClient _defaultYteClient = new YoutubeClient();
|
||||
private static readonly YoutubeClient _defaultYteClient = new YoutubeClient();
|
||||
|
||||
private static string[] Scopes { get; } = new string[]
|
||||
{
|
||||
@@ -131,6 +131,7 @@ namespace FoxTube
|
||||
|
||||
await CurrentUser.Credential.RevokeTokenAsync(CancellationToken.None);
|
||||
|
||||
storage.Values.Remove($"Subscriptions.{CurrentUser.UserInfo.Id}");
|
||||
CurrentUser = null;
|
||||
Users[Users.ToList().FindIndex(i => i.Id == userId)] = null;
|
||||
|
||||
@@ -201,5 +202,8 @@ namespace FoxTube
|
||||
else
|
||||
vaultCredential.Password = refreshToken;
|
||||
}
|
||||
|
||||
internal static void SubscriptionsChangedInvoker(User sender, Subscription subscription) =>
|
||||
SubscriptionsChanged?.Invoke(sender, subscription);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user