Fix account persistence edge case
This commit is contained in:
parent
dd25792864
commit
dd3b032b21
@ -91,5 +91,7 @@ namespace InternalUtilities
|
|||||||
ArgumentValidator.EnsureNotNullOrWhiteSpace(accountId, nameof(accountId));
|
ArgumentValidator.EnsureNotNullOrWhiteSpace(accountId, nameof(accountId));
|
||||||
AccountId = accountId.Trim();
|
AccountId = accountId.Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString() => $"{AccountId} - {Locale?.Name ?? "[empty]"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,7 +113,9 @@ namespace InternalUtilities
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
account.Updated -= update;
|
account.Updated -= update;
|
||||||
return _accounts_backing.Remove(account);
|
var result = _accounts_backing.Remove(account);
|
||||||
|
update_no_validate();
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validate(Account account)
|
private void validate(Account account)
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
<!-- <PublishSingleFile>true</PublishSingleFile> -->
|
<!-- <PublishSingleFile>true</PublishSingleFile> -->
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
|
|
||||||
<Version>3.1.12.271</Version>
|
<Version>3.1.12.279</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -8,6 +8,7 @@ using Dinah.Core;
|
|||||||
using Dinah.Core.Drawing;
|
using Dinah.Core.Drawing;
|
||||||
using Dinah.Core.Windows.Forms;
|
using Dinah.Core.Windows.Forms;
|
||||||
using FileManager;
|
using FileManager;
|
||||||
|
using InternalUtilities;
|
||||||
using LibationWinForms.Dialogs;
|
using LibationWinForms.Dialogs;
|
||||||
|
|
||||||
namespace LibationWinForms
|
namespace LibationWinForms
|
||||||
@ -42,6 +43,8 @@ namespace LibationWinForms
|
|||||||
PictureStorage.SetDefaultImage(PictureSize._300x300, Properties.Resources.default_cover_300x300.ToBytes(format));
|
PictureStorage.SetDefaultImage(PictureSize._300x300, Properties.Resources.default_cover_300x300.ToBytes(format));
|
||||||
PictureStorage.SetDefaultImage(PictureSize._500x500, Properties.Resources.default_cover_500x500.ToBytes(format));
|
PictureStorage.SetDefaultImage(PictureSize._500x500, Properties.Resources.default_cover_500x500.ToBytes(format));
|
||||||
|
|
||||||
|
setImportMenu();
|
||||||
|
|
||||||
setVisibleCount(null, 0);
|
setVisibleCount(null, 0);
|
||||||
|
|
||||||
reloadGrid();
|
reloadGrid();
|
||||||
@ -225,7 +228,16 @@ namespace LibationWinForms
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region index menu
|
#region Import menu
|
||||||
|
private void setImportMenu()
|
||||||
|
{
|
||||||
|
var hasMultipleAccounts = AudibleApiStorage.GetPersistentAccountsSettings().Accounts.Count > 1;
|
||||||
|
|
||||||
|
scanLibraryToolStripMenuItem.Visible = !hasMultipleAccounts;
|
||||||
|
scanLibraryOfAllAccountsToolStripMenuItem.Visible = hasMultipleAccounts;
|
||||||
|
scanLibraryOfSomeAccountsToolStripMenuItem.Visible = hasMultipleAccounts;
|
||||||
|
}
|
||||||
|
|
||||||
private void scanLibraryToolStripMenuItem_Click(object sender, EventArgs e)
|
private void scanLibraryToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
using var dialog = new IndexLibraryDialog();
|
using var dialog = new IndexLibraryDialog();
|
||||||
@ -309,7 +321,10 @@ private void scanLibraryOfSomeAccountsToolStripMenuItem_Click(object sender, Eve
|
|||||||
|
|
||||||
#region settings menu
|
#region settings menu
|
||||||
private void accountsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void accountsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
=> new AccountsDialog().ShowDialog();
|
{
|
||||||
|
new AccountsDialog().ShowDialog();
|
||||||
|
setImportMenu();
|
||||||
|
}
|
||||||
|
|
||||||
private void basicSettingsToolStripMenuItem_Click(object sender, EventArgs e) => new SettingsDialog().ShowDialog();
|
private void basicSettingsToolStripMenuItem_Click(object sender, EventArgs e) => new SettingsDialog().ShowDialog();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user