feat: Add NFO UI features (Task 6)
- Extended AnimeSummary model with NFO fields (has_nfo, nfo_created_at, nfo_updated_at, tmdb_id, tvdb_id) - Updated list_anime endpoint to fetch and return NFO data from database - Added NFO status badges to series cards (green=exists, gray=missing) - Created nfo-manager.js module with createNFO, refreshNFO, viewNFO operations - Added NFO action buttons to series cards (Create/View/Refresh) - Integrated WebSocket handlers for real-time NFO events (creating, completed, failed) - Added CSS styles for NFO badges and action buttons - All 34 NFO API tests passing, all 32 anime endpoint tests passing - Documented in docs/task6_status.md (90% complete, NFO status page deferred)
This commit is contained in:
@@ -237,6 +237,35 @@ AniWorld.IndexSocketHandler = (function() {
|
||||
AniWorld.ConfigManager.hideStatus();
|
||||
AniWorld.UI.showToast('Download cancelled', 'warning');
|
||||
});
|
||||
|
||||
// NFO events
|
||||
socket.on('nfo_creating', function(data) {
|
||||
console.log('NFO creation started:', data);
|
||||
AniWorld.UI.showToast(
|
||||
'Creating NFO for ' + (data.series_name || data.series_key),
|
||||
'info'
|
||||
);
|
||||
});
|
||||
|
||||
socket.on('nfo_completed', function(data) {
|
||||
console.log('NFO creation completed:', data);
|
||||
AniWorld.UI.showToast(
|
||||
'NFO created for ' + (data.series_name || data.series_key),
|
||||
'success'
|
||||
);
|
||||
// Reload series to reflect new NFO status
|
||||
if (AniWorld.SeriesManager && AniWorld.SeriesManager.loadSeries) {
|
||||
AniWorld.SeriesManager.loadSeries();
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('nfo_failed', function(data) {
|
||||
console.error('NFO creation failed:', data);
|
||||
AniWorld.UI.showToast(
|
||||
'NFO creation failed: ' + (data.message || data.error || 'Unknown error'),
|
||||
'error'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user