feat(nfo): implement NFO diagnostics and repair

- Add NFO API endpoints: diagnostics, repair, validate, needs-repair
- Create /settings/nfo page with full NFO management UI
- Add NFO status section to edit modal with repair functionality
- Add anime details API for edit modal pre-fill data
- Fix auth test fixtures in test_nfo_diagnostics_repair.py

Implements NFO diagnostics when editing anime series via right-click menu.
Users can now check NFO status, see missing tags, and repair NFOs
directly from the edit modal or the dedicated NFO settings page.
This commit is contained in:
2026-06-14 19:34:58 +02:00
parent 75084b3941
commit 6dc3cda810
11 changed files with 2278 additions and 319 deletions

View File

@@ -469,4 +469,101 @@
flex-shrink: 0;
}
/* Series Info Grid (Read-only display) */
.info-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: var(--spacing-sm) var(--spacing-lg);
}
.info-item {
display: flex;
flex-direction: column;
gap: 2px;
}
.info-item label {
font-size: var(--font-size-caption);
color: var(--color-text-secondary);
font-weight: 500;
}
.info-item .info-value {
font-size: var(--font-size-body);
color: var(--color-text-primary);
}
/* Input with action button */
.input-with-action {
display: flex;
gap: var(--spacing-sm);
align-items: center;
}
.input-with-action .input-field {
flex: 1;
}
.btn-fetch-tmdb {
flex-shrink: 0;
white-space: nowrap;
}
/* TMDB Search Results */
.tmdb-search-results {
margin-top: var(--spacing-sm);
border: 1px solid var(--color-border);
border-radius: var(--border-radius);
background: var(--color-surface);
max-height: 200px;
overflow-y: auto;
}
.tmdb-result-item {
padding: var(--spacing-sm) var(--spacing-md);
cursor: pointer;
border-bottom: 1px solid var(--color-divider);
display: flex;
flex-direction: column;
gap: 2px;
}
.tmdb-result-item:last-child {
border-bottom: none;
}
.tmdb-result-item:hover {
background: var(--color-background-subtle);
}
.tmdb-result-title {
font-weight: 500;
color: var(--color-text-primary);
}
.tmdb-result-overview {
font-size: var(--font-size-caption);
color: var(--color-text-secondary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tmdb-error,
.tmdb-no-results,
.tmdb-selected {
padding: var(--spacing-sm) var(--spacing-md);
font-size: var(--font-size-caption);
color: var(--color-text-secondary);
margin: 0;
}
.tmdb-error {
color: var(--color-error, #e74c3c);
}
.tmdb-selected {
color: var(--color-success, #2ecc71);
}

View File

@@ -0,0 +1,427 @@
/* NFO Settings Page Styles */
#app {
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* Header */
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 2rem;
background: var(--color-surface);
border-bottom: 1px solid var(--color-border);
}
.header-left .back-link {
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--color-text-secondary);
text-decoration: none;
font-size: 0.875rem;
transition: color 0.2s;
}
.header-left .back-link:hover {
color: var(--color-primary);
}
.header-center h1 {
font-size: 1.25rem;
font-weight: 600;
color: var(--color-text);
}
.header-right {
display: flex;
gap: 0.75rem;
}
/* Stats Bar */
.stats-bar {
display: flex;
gap: 1rem;
padding: 1rem 2rem;
background: var(--color-surface);
border-bottom: 1px solid var(--color-border);
}
.stat-item {
display: flex;
flex-direction: column;
align-items: center;
padding: 0.75rem 1.5rem;
background: var(--color-background);
border-radius: 8px;
min-width: 120px;
}
.stat-value {
font-size: 1.5rem;
font-weight: 700;
color: var(--color-text);
}
.stat-label {
font-size: 0.75rem;
color: var(--color-text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.stat-missing .stat-value {
color: var(--color-error);
}
.stat-incomplete .stat-value {
color: var(--color-warning);
}
.stat-complete .stat-value {
color: var(--color-success);
}
/* Toolbar */
.toolbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 2rem;
background: var(--color-surface);
border-bottom: 1px solid var(--color-border);
}
.search-box {
position: relative;
width: 300px;
}
.search-box i {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
color: var(--color-text-secondary);
}
.search-box .input-field {
width: 100%;
padding-left: 2.5rem;
}
.filter-buttons {
display: flex;
gap: 0.5rem;
}
.filter-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
background: var(--color-background);
border: 1px solid var(--color-border);
border-radius: 6px;
color: var(--color-text-secondary);
cursor: pointer;
transition: all 0.2s;
}
.filter-btn:hover {
background: var(--color-surface-hover);
color: var(--color-text);
}
.filter-btn.active {
background: var(--color-primary);
border-color: var(--color-primary);
color: white;
}
.filter-btn .count {
background: rgba(255, 255, 255, 0.2);
padding: 0.125rem 0.5rem;
border-radius: 10px;
font-size: 0.75rem;
}
.filter-btn:not(.active) .count {
background: var(--color-border);
}
/* Series List */
.series-list-container {
flex: 1;
padding: 1rem 2rem;
overflow-y: auto;
}
.series-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
gap: 1rem;
}
.loading-state,
.empty-state {
grid-column: 1 / -1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 4rem;
color: var(--color-text-secondary);
}
.loading-state i {
font-size: 2rem;
margin-bottom: 1rem;
}
.empty-state i {
font-size: 3rem;
color: var(--color-success);
margin-bottom: 1rem;
}
/* Series Card */
.series-card {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: 8px;
padding: 1rem;
cursor: pointer;
transition: all 0.2s;
}
.series-card:hover {
border-color: var(--color-primary);
transform: translateY(-2px);
}
.series-card.missing {
border-left: 4px solid var(--color-error);
}
.series-card.incomplete {
border-left: 4px solid var(--color-warning);
}
.series-card.complete {
border-left: 4px solid var(--color-success);
}
.series-card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 0.75rem;
}
.series-name {
font-size: 1rem;
font-weight: 600;
color: var(--color-text);
margin: 0;
}
.series-folder {
font-size: 0.75rem;
color: var(--color-text-secondary);
margin-top: 0.25rem;
}
.nfo-status-badge {
display: inline-block;
padding: 0.25rem 0.75rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
}
.nfo-status-badge.missing,
.nfo-status-badge.no-nfo {
background: var(--color-error-bg);
color: var(--color-error);
}
.nfo-status-badge.incomplete {
background: var(--color-warning-bg);
color: var(--color-warning);
}
.nfo-status-badge.complete {
background: var(--color-success-bg);
color: var(--color-success);
}
.missing-tags-list {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin-top: 0.5rem;
}
.missing-tag-chip {
display: inline-block;
padding: 0.25rem 0.5rem;
background: var(--color-background);
border-radius: 4px;
font-size: 0.75rem;
color: var(--color-text-secondary);
}
/* Detail Panel */
.detail-panel {
position: fixed;
top: 0;
right: 0;
bottom: 0;
width: 500px;
z-index: 1000;
display: flex;
}
.detail-panel.hidden {
display: none;
}
.panel-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
}
.panel-content {
position: relative;
width: 100%;
background: var(--color-surface);
box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
}
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--color-border);
}
.panel-header h3 {
font-size: 1.125rem;
font-weight: 600;
color: var(--color-text);
margin: 0;
}
.panel-body {
flex: 1;
padding: 1.5rem;
overflow-y: auto;
}
.detail-section {
margin-bottom: 1.5rem;
}
.detail-section h4 {
font-size: 0.875rem;
font-weight: 600;
color: var(--color-text-secondary);
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 0.75rem;
}
.status-display {
display: flex;
align-items: center;
gap: 1rem;
}
.nfo-path {
font-size: 0.75rem;
color: var(--color-text-secondary);
word-break: break-all;
}
.action-buttons {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.action-buttons .btn {
justify-content: center;
}
.nfo-preview {
background: var(--color-background);
border: 1px solid var(--color-border);
border-radius: 6px;
padding: 1rem;
max-height: 300px;
overflow: auto;
font-size: 0.75rem;
line-height: 1.5;
}
.nfo-preview code {
color: var(--color-text-secondary);
white-space: pre-wrap;
word-break: break-all;
}
/* Responsive */
@media (max-width: 768px) {
.page-header {
flex-wrap: wrap;
gap: 1rem;
}
.stats-bar {
flex-wrap: wrap;
padding: 0.75rem 1rem;
}
.stat-item {
min-width: 100px;
padding: 0.5rem 1rem;
}
.toolbar {
flex-direction: column;
gap: 1rem;
padding: 0.75rem 1rem;
}
.search-box {
width: 100%;
}
.filter-buttons {
flex-wrap: wrap;
}
.series-list-container {
padding: 1rem;
}
.series-list {
grid-template-columns: 1fr;
}
.detail-panel {
width: 100%;
}
}