From 7bb4853903cf8e51fa1c61fff2222b8f292527a9 Mon Sep 17 00:00:00 2001 From: Robert McRackan Date: Fri, 6 Dec 2019 09:53:07 -0500 Subject: [PATCH] Clicking Liberate button on a liberated item navigates to that audio file --- LibationWinForm/UNTESTED/ProductsGrid.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/LibationWinForm/UNTESTED/ProductsGrid.cs b/LibationWinForm/UNTESTED/ProductsGrid.cs index 510aed7b..00b63737 100644 --- a/LibationWinForm/UNTESTED/ProductsGrid.cs +++ b/LibationWinForm/UNTESTED/ProductsGrid.cs @@ -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