Set Import/Esport initial directory
This commit is contained in:
parent
2341f6ea3b
commit
fa195483d6
@ -429,7 +429,7 @@ namespace AppScaffolding
|
|||||||
string updateContentType =
|
string updateContentType =
|
||||||
"UPDATE books " +
|
"UPDATE books " +
|
||||||
"SET contenttype = 4 " +
|
"SET contenttype = 4 " +
|
||||||
"WHERE audibleproductid IN(SELECT books.audibleproductid " +
|
"WHERE audibleproductid IN (SELECT books.audibleproductid " +
|
||||||
"FROM books " +
|
"FROM books " +
|
||||||
"INNER JOIN series " +
|
"INNER JOIN series " +
|
||||||
"ON ( books.audibleproductid = " +
|
"ON ( books.audibleproductid = " +
|
||||||
@ -445,7 +445,7 @@ namespace AppScaffolding
|
|||||||
"'- 1' " +
|
"'- 1' " +
|
||||||
"FROM books " +
|
"FROM books " +
|
||||||
"LEFT OUTER JOIN seriesbook " +
|
"LEFT OUTER JOIN seriesbook " +
|
||||||
"ON books.bookid = seriesbook.bookid " +
|
"ON books.bookid = seriesbook.bookid " +
|
||||||
"INNER JOIN series " +
|
"INNER JOIN series " +
|
||||||
"ON books.audibleproductid = series.audibleseriesid " +
|
"ON books.audibleproductid = series.audibleseriesid " +
|
||||||
"WHERE books.contenttype = 4 " +
|
"WHERE books.contenttype = 4 " +
|
||||||
|
|||||||
@ -210,6 +210,9 @@ namespace LibationWinForms.Dialogs
|
|||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
private string GetAudibleCliAppDataPath()
|
||||||
|
=> Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Audible");
|
||||||
|
|
||||||
private void Export(string accountId, string locale)
|
private void Export(string accountId, string locale)
|
||||||
{
|
{
|
||||||
// without transaction, accounts persister will write ANY EDIT immediately to file
|
// without transaction, accounts persister will write ANY EDIT immediately to file
|
||||||
@ -229,6 +232,11 @@ namespace LibationWinForms.Dialogs
|
|||||||
SaveFileDialog sfd = new();
|
SaveFileDialog sfd = new();
|
||||||
sfd.Filter = "JSON File|*.json";
|
sfd.Filter = "JSON File|*.json";
|
||||||
|
|
||||||
|
string audibleAppDataDir = GetAudibleCliAppDataPath();
|
||||||
|
|
||||||
|
if (Directory.Exists(audibleAppDataDir))
|
||||||
|
sfd.InitialDirectory = audibleAppDataDir;
|
||||||
|
|
||||||
if (sfd.ShowDialog() != DialogResult.OK) return;
|
if (sfd.ShowDialog() != DialogResult.OK) return;
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -249,10 +257,17 @@ namespace LibationWinForms.Dialogs
|
|||||||
ex);
|
ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void importBtn_Click(object sender, EventArgs e)
|
private async void importBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
OpenFileDialog ofd = new();
|
OpenFileDialog ofd = new();
|
||||||
ofd.Filter = "JSON File|*.json";
|
ofd.Filter = "JSON File|*.json";
|
||||||
|
ofd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||||
|
|
||||||
|
string audibleAppDataDir = GetAudibleCliAppDataPath();
|
||||||
|
|
||||||
|
if (Directory.Exists(audibleAppDataDir))
|
||||||
|
ofd.InitialDirectory = audibleAppDataDir;
|
||||||
|
|
||||||
if (ofd.ShowDialog() != DialogResult.OK) return;
|
if (ofd.ShowDialog() != DialogResult.OK) return;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user