mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Delete files when deleting series
New: Option to delete files when deleting series
This commit is contained in:
parent
a7fd486b03
commit
b52dcfd2ef
6 changed files with 50 additions and 27 deletions
|
@ -13,21 +13,17 @@ $("#seriesEditor").dialog({
|
|||
text: "Delete",
|
||||
class: "ui-delete-button",
|
||||
click: function () {
|
||||
var answer = confirm("Are you sure you want to delete this series?");
|
||||
if (answer) {
|
||||
var seriesId = $('#SeriesId').val();
|
||||
$(this).dialog("close");
|
||||
|
||||
//Get the SeriesId and Title
|
||||
var seriesId = $('#SeriesId').val();
|
||||
var title = $('[aria-labelledby="ui-dialog-title-seriesEditor"]').find('#ui-dialog-title-seriesEditor').text();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: seriesDeleteUrl,
|
||||
data: { seriesId: seriesId },
|
||||
success: function (data) {
|
||||
//Remove the row from the grid... along with the details row
|
||||
afterDelete();
|
||||
}
|
||||
});
|
||||
$(this).dialog("close");
|
||||
}
|
||||
//Fill in the view
|
||||
$('#seriesDelete').children('.seriesId').val(seriesId);
|
||||
$('#seriesDelete').children('.seriesTitle').html(title);
|
||||
|
||||
$("#seriesDelete").dialog("open");
|
||||
}
|
||||
},
|
||||
"Save": function () {
|
||||
|
@ -52,12 +48,12 @@ $("#seriesDelete").dialog({
|
|||
buttons: {
|
||||
"Delete": function () {
|
||||
var seriesId = $('.seriesId').val();
|
||||
var deleteFiles = $('#DeleteFilesFromDisk').is(':checked');
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: seriesDeleteUrl,
|
||||
data: { seriesId: seriesId },
|
||||
data: { seriesId: seriesId, deleteFiles: deleteFiles },
|
||||
success: function (data) {
|
||||
//Remove the row from the grid... along with the details row
|
||||
afterDelete(seriesId);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue