Add Re-download context menu item

This commit is contained in:
Mbucari 2023-07-09 16:26:58 -06:00
parent 4899ef3007
commit 7d09728e6b
3 changed files with 264 additions and 326 deletions

View File

@ -202,6 +202,25 @@ namespace LibationAvalonia.Views
#endregion #endregion
} }
#region Force Re-Download
if (!entry.Liberate.IsSeries)
{
var reDownloadMenuItem = new MenuItem()
{
Header = "Re-download this audiobook",
IsEnabled = entry.Book.UserDefinedItem.BookStatus is LiberatedStatus.Liberated
};
args.ContextMenuItems.Add(reDownloadMenuItem);
reDownloadMenuItem.Click += (s, _) =>
{
//No need to persist this change. It only needs to last long for the file to start downloading
entry.Book.UserDefinedItem.BookStatus = LiberatedStatus.NotLiberated;
LiberateClicked?.Invoke(s, entry.LibraryBook);
};
}
#endregion
args.ContextMenuItems.Add(new Separator()); args.ContextMenuItems.Add(new Separator());
#region View Bookmarks/Clips #region View Bookmarks/Clips

File diff suppressed because it is too large Load Diff

View File

@ -206,6 +206,25 @@ namespace LibationWinForms.GridView
#endregion #endregion
} }
#region Force Re-Download
if (!entry.Liberate.IsSeries)
{
var reDownloadMenuItem = new ToolStripMenuItem()
{
Text = "Re-download this audiobook",
Enabled = entry.Book.UserDefinedItem.BookStatus is LiberatedStatus.Liberated
};
ctxMenu.Items.Add(reDownloadMenuItem);
reDownloadMenuItem.Click += (s, _) =>
{
//No need to persist this change. It only needs to last long for the file to start downloading
entry.Book.UserDefinedItem.BookStatus = LiberatedStatus.NotLiberated;
LiberateClicked?.Invoke(s, entry.LibraryBook);
};
}
#endregion
ctxMenu.Items.Add(new ToolStripSeparator()); ctxMenu.Items.Add(new ToolStripSeparator());
#region View Bookmarks/Clips #region View Bookmarks/Clips