fix: update to not add empty dirs
Local Docker Build (Dev) / build-dev (push) Successful in 4s
Local Docker Build (Main) / build (pull_request) Successful in 4s
Local Docker Build (Main) / deploy (pull_request) Has been skipped

This commit is contained in:
2025-10-20 10:26:29 -04:00
parent 148937ae08
commit 808322c7c7
4 changed files with 191 additions and 4 deletions
+37
View File
@@ -289,6 +289,9 @@ function updateMoviesTable(data) {
<button class="btn btn-sm btn-secondary" onclick="debugMovie('${movie.imdb_id}')" title="Debug Data">
<i class="fas fa-bug"></i>
</button>
<button class="btn btn-sm btn-danger" onclick="deleteMovie('${movie.imdb_id}')" style="margin-left: 5px;" title="Delete Movie">
<i class="fas fa-trash"></i> Delete
</button>
</td>
</tr>
`;
@@ -1315,6 +1318,40 @@ async function deleteEpisode(imdbId, season, episode) {
}
}
// Movie deletion functionality
async function deleteMovie(imdbId) {
// Confirmation dialog
if (!confirm(`⚠️ Delete Movie?\n\nThis will permanently remove the movie (${imdbId}) from the database.\n\nAre you sure you want to continue?`)) {
return;
}
try {
const response = await fetch(`/database/movie/${imdbId}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
}
});
const result = await response.json();
if (response.ok && result.success) {
showToast(`✅ Movie deleted successfully`, 'success');
// Refresh the movies table
loadMovies(currentMoviesPage);
} else {
const errorMsg = result.message || result.error || 'Unknown error';
showToast(`❌ Failed to delete movie: ${errorMsg}`, 'error');
}
} catch (error) {
console.error('Delete movie failed:', error);
showToast(`❌ Delete failed: ${error.message}`, 'error');
}
}
// Update episode counts in modal after deletion
function updateEpisodeModalCounts() {
const remainingRows = document.querySelectorAll('#episodes-table-body tr');