imdb: missing imdge improvments
This commit is contained in:
@@ -1150,6 +1150,105 @@ textarea {
|
||||
border-color: #117a8b;
|
||||
}
|
||||
|
||||
/* Missing IMDb Items Styles */
|
||||
.missing-imdb-table-container {
|
||||
overflow-x: auto;
|
||||
max-height: 600px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 8px;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.missing-imdb-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
min-width: 800px;
|
||||
}
|
||||
|
||||
.missing-imdb-table thead {
|
||||
background-color: var(--bg-secondary);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.missing-imdb-table th,
|
||||
.missing-imdb-table td {
|
||||
padding: 0.75rem;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.missing-imdb-table th {
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.missing-imdb-table td {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.missing-imdb-table .file-path {
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
||||
font-size: 0.85rem;
|
||||
max-width: 300px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.media-type-badge {
|
||||
display: inline-block;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.media-type-badge.tv-series {
|
||||
background-color: #e3f2fd;
|
||||
color: #1976d2;
|
||||
}
|
||||
|
||||
.media-type-badge.movie {
|
||||
background-color: #fff3e0;
|
||||
color: #f57c00;
|
||||
}
|
||||
|
||||
.missing-imdb-actions {
|
||||
background-color: var(--bg-secondary);
|
||||
padding: 1rem;
|
||||
border-radius: 8px;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.missing-imdb-actions ul {
|
||||
margin: 0.5rem 0 0 1rem;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.missing-imdb-actions li {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.missing-imdb-actions code {
|
||||
background-color: var(--bg-primary);
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: 4px;
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
||||
font-size: 0.85rem;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.btn-small {
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 0.75rem;
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
/* Responsive adjustments for admin tools */
|
||||
@media (max-width: 768px) {
|
||||
.table-container {
|
||||
@@ -1168,4 +1267,18 @@ textarea {
|
||||
.admin-tools {
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.missing-imdb-table {
|
||||
min-width: 600px;
|
||||
}
|
||||
|
||||
.missing-imdb-table th,
|
||||
.missing-imdb-table td {
|
||||
padding: 0.5rem;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.missing-imdb-table .file-path {
|
||||
max-width: 200px;
|
||||
}
|
||||
}
|
||||
@@ -455,6 +455,9 @@
|
||||
<button class="btn btn-info" onclick="showEpisodesMissingNFODateadded()">
|
||||
<i class="fas fa-exclamation-triangle"></i> Episodes Missing NFO dateadded
|
||||
</button>
|
||||
<button class="btn btn-warning" onclick="showMissingImdbItems()">
|
||||
<i class="fas fa-search"></i> Items Missing IMDb IDs
|
||||
</button>
|
||||
<button class="btn btn-secondary" onclick="exportDatabaseReport()">
|
||||
<i class="fas fa-download"></i> Export Database Report
|
||||
</button>
|
||||
|
||||
@@ -2031,6 +2031,90 @@ async function showEpisodesMissingNFODateadded() {
|
||||
}
|
||||
}
|
||||
|
||||
async function showMissingImdbItems() {
|
||||
const resultsDiv = document.getElementById('admin-results');
|
||||
const resultsContent = document.getElementById('admin-results-content');
|
||||
|
||||
try {
|
||||
resultsContent.innerHTML = '<div class="loading">Checking for items missing IMDb IDs...</div>';
|
||||
resultsDiv.style.display = 'block';
|
||||
|
||||
const response = await apiCall('/api/admin/missing-imdb');
|
||||
|
||||
if (response.success) {
|
||||
let html = `
|
||||
<h4>Items Missing IMDb IDs</h4>
|
||||
<p><strong>Found:</strong> ${response.total_missing} items missing IMDb IDs</p>
|
||||
<p><strong>TV Series:</strong> ${response.tv_series_missing} | <strong>Movies:</strong> ${response.movies_missing}</p>
|
||||
`;
|
||||
|
||||
if (response.total_missing > 0) {
|
||||
html += `
|
||||
<p><strong>Recommendation:</strong> These items need manual IMDb ID assignment or folder/filename correction.</p>
|
||||
<div class="missing-imdb-table-container">
|
||||
<table class="missing-imdb-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10%">Type</th>
|
||||
<th style="width: 25%">Folder Name</th>
|
||||
<th style="width: 35%">File Path</th>
|
||||
<th style="width: 15%">Discovered</th>
|
||||
<th style="width: 10%">Checks</th>
|
||||
<th style="width: 5%">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
`;
|
||||
|
||||
response.items.forEach(item => {
|
||||
const discoveredDate = item.discovered_at ? new Date(item.discovered_at).toLocaleDateString() : 'Unknown';
|
||||
const checkCount = item.check_count || 1;
|
||||
|
||||
html += `
|
||||
<tr>
|
||||
<td>
|
||||
<span class="media-type-badge ${item.type.toLowerCase().replace(' ', '-')}">${item.type}</span>
|
||||
</td>
|
||||
<td title="${item.folder_name}">${item.folder_name}</td>
|
||||
<td title="${item.file_path}" class="file-path">${item.file_path}</td>
|
||||
<td>${discoveredDate}</td>
|
||||
<td>${checkCount}</td>
|
||||
<td>
|
||||
<button class="btn btn-small btn-info" title="Copy path to clipboard" onclick="copyToClipboard('${item.file_path}')">
|
||||
<i class="fas fa-copy"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
html += `
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="missing-imdb-actions">
|
||||
<p><strong>How to fix:</strong></p>
|
||||
<ul>
|
||||
<li>Add IMDb ID to folder name: <code>[imdb-tt1234567]</code></li>
|
||||
<li>Add IMDb ID to filename: <code>Movie.Name.2023.imdb-tt1234567.mkv</code></li>
|
||||
<li>Add IMDb ID to NFO file content</li>
|
||||
<li>Check folder structure and naming conventions</li>
|
||||
</ul>
|
||||
</div>
|
||||
`;
|
||||
} else {
|
||||
html += '<p>✅ All items have valid IMDb IDs!</p>';
|
||||
}
|
||||
|
||||
resultsContent.innerHTML = html;
|
||||
} else {
|
||||
resultsContent.innerHTML = `<div class="error">Error: ${response.message}</div>`;
|
||||
}
|
||||
} catch (error) {
|
||||
resultsContent.innerHTML = `<div class="error">Failed to check missing IMDb items: ${error.message}</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
async function exportDatabaseReport() {
|
||||
alert('Database export functionality will be implemented in a future update.');
|
||||
}
|
||||
@@ -2092,4 +2176,30 @@ async function showRecentWebhookActivity() {
|
||||
} catch (error) {
|
||||
resultsContent.innerHTML = `<div class="error">Failed to load webhook activity: ${error.message}</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
async function copyToClipboard(text) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
// Show a temporary success message
|
||||
const button = event.target.closest('button');
|
||||
const originalIcon = button.innerHTML;
|
||||
button.innerHTML = '<i class="fas fa-check"></i>';
|
||||
button.style.backgroundColor = '#4CAF50';
|
||||
|
||||
setTimeout(() => {
|
||||
button.innerHTML = originalIcon;
|
||||
button.style.backgroundColor = '';
|
||||
}, 1500);
|
||||
} catch (err) {
|
||||
// Fallback for older browsers
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.value = text;
|
||||
document.body.appendChild(textArea);
|
||||
textArea.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(textArea);
|
||||
|
||||
alert('Path copied to clipboard!');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user