Skip to content

Commit

Permalink
Clicking Liberate button on a liberated item navigates to that audio …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
Robert McRackan committed Dec 6, 2019
1 parent f9917d4 commit 7bb4853
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions LibationWinForm/UNTESTED/ProductsGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,18 @@ private async void liberate_Click(object sender, DataGridViewCellEventArgs e)

var productId = GetGridEntry(e.RowIndex).GetBook().AudibleProductId;

var backupBook = BookLiberation.ProcessorAutomationController.GetWiredUpBackupBook((_, __) => RefreshRow(productId));
await BookLiberation.ProcessorAutomationController.RunSingleBackupAsync(backupBook, productId);
// if liberated, open explorer to file
if (FileManager.AudibleFileStorage.Audio.Exists(productId))
{
var filePath = FileManager.AudibleFileStorage.Audio.GetPath(productId);
System.Diagnostics.Process.Start("explorer.exe", $"/select, \"{filePath}\"");
}
// else liberate
else
{
var backupBook = BookLiberation.ProcessorAutomationController.GetWiredUpBackupBook((_, __) => RefreshRow(productId));
await BookLiberation.ProcessorAutomationController.RunSingleBackupAsync(backupBook, productId);
}
}
#endregion

Expand Down

0 comments on commit 7bb4853

Please sign in to comment.