Ask users to clear the accounts when enabling widevine (#1249)
This commit is contained in:
parent
f35c82d59d
commit
ef67ae9d6a
@ -31,10 +31,29 @@ namespace LibationAvalonia.Controls.Settings
|
|||||||
if (!accounts.AccountsSettings.Accounts.Any(a => a.IdentityTokens.DeviceType == AudibleApi.Resources.DeviceType))
|
if (!accounts.AccountsSettings.Accounts.Any(a => a.IdentityTokens.DeviceType == AudibleApi.Resources.DeviceType))
|
||||||
{
|
{
|
||||||
if (VisualRoot is Window parent)
|
if (VisualRoot is Window parent)
|
||||||
await MessageBox.Show(parent,
|
{
|
||||||
"Your must remove account(s) from Libation and then re-add them to enable widwvine content.",
|
var choice = await MessageBox.Show(parent,
|
||||||
|
"In order to enable widevine content, Libation will need to log into your accounts again.\r\n\r\n" +
|
||||||
|
"Do you want Libation to clear your current account settings and prompt you to login before the next download?",
|
||||||
"Widevine Content Unavailable",
|
"Widevine Content Unavailable",
|
||||||
MessageBoxButtons.OK);
|
MessageBoxButtons.YesNo,
|
||||||
|
MessageBoxIcon.Question,
|
||||||
|
MessageBoxDefaultButton.Button2);
|
||||||
|
|
||||||
|
if (choice == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
foreach (var account in accounts.AccountsSettings.Accounts.ToArray())
|
||||||
|
{
|
||||||
|
if (account.IdentityTokens.DeviceType != AudibleApi.Resources.DeviceType)
|
||||||
|
{
|
||||||
|
accounts.AccountsSettings.Delete(account);
|
||||||
|
var acc = accounts.AccountsSettings.Upsert(account.AccountId, account.Locale.Name);
|
||||||
|
acc.AccountName = account.AccountName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_viewModel.UseWidevine = false;
|
_viewModel.UseWidevine = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -257,7 +257,7 @@ namespace LibationFileManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Description("Use widevine DRM")]
|
[Description("Use widevine DRM")]
|
||||||
public bool UseWidevine { get => GetNonString(defaultValue: true); set => SetNonString(value); }
|
public bool UseWidevine { get => GetNonString(defaultValue: false); set => SetNonString(value); }
|
||||||
|
|
||||||
[Description("Request Spatial Audio")]
|
[Description("Request Spatial Audio")]
|
||||||
public bool RequestSpatial { get => GetNonString(defaultValue: true); set => SetNonString(value); }
|
public bool RequestSpatial { get => GetNonString(defaultValue: true); set => SetNonString(value); }
|
||||||
|
|||||||
@ -206,10 +206,28 @@ namespace LibationWinForms.Dialogs
|
|||||||
|
|
||||||
if (!accounts.AccountsSettings.Accounts.Any(a => a.IdentityTokens.DeviceType == AudibleApi.Resources.DeviceType))
|
if (!accounts.AccountsSettings.Accounts.Any(a => a.IdentityTokens.DeviceType == AudibleApi.Resources.DeviceType))
|
||||||
{
|
{
|
||||||
MessageBox.Show(this,
|
var choice = MessageBox.Show(this,
|
||||||
"Your must remove account(s) from Libation and then re-add them to enable widwvine content.",
|
"In order to enable widevine content, Libation will need to log into your accounts again.\r\n\r\n" +
|
||||||
|
"Do you want Libation to clear your current account settings and prompt you to login before the next download?",
|
||||||
"Widevine Content Unavailable",
|
"Widevine Content Unavailable",
|
||||||
MessageBoxButtons.OK);
|
MessageBoxButtons.YesNo,
|
||||||
|
MessageBoxIcon.Question,
|
||||||
|
MessageBoxDefaultButton.Button2);
|
||||||
|
|
||||||
|
if (choice == DialogResult.Yes)
|
||||||
|
{
|
||||||
|
foreach (var account in accounts.AccountsSettings.Accounts.ToArray())
|
||||||
|
{
|
||||||
|
if (account.IdentityTokens.DeviceType != AudibleApi.Resources.DeviceType)
|
||||||
|
{
|
||||||
|
accounts.AccountsSettings.Delete(account);
|
||||||
|
var acc = accounts.AccountsSettings.Upsert(account.AccountId, account.Locale.Name);
|
||||||
|
acc.AccountName = account.AccountName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
useWidevineCbox.Checked = false;
|
useWidevineCbox.Checked = false;
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user