diff --git a/src/server/web/static/js/index/socket-handler.js b/src/server/web/static/js/index/socket-handler.js index 37859ad..96a294a 100644 --- a/src/server/web/static/js/index/socket-handler.js +++ b/src/server/web/static/js/index/socket-handler.js @@ -136,13 +136,16 @@ AniWorld.IndexSocketHandler = (function() { // Series events socket.on(WS_EVENTS.SERIES_UPDATED, function(data) { console.log('Series updated:', data); - - // Use the data directly to update the series instead of full refresh - if (data && data.data && AniWorld.SeriesManager && AniWorld.SeriesManager.updateSingleSeries) { - AniWorld.SeriesManager.updateSingleSeries(data.data); + + // NOTE: websocket-client.js strips the outer {type, data, ...} wrapper + // before emitting, so `data` here is the inner series data object + // (e.g. {key, name, missing_episodes, ...}) — NOT {type, data, ...}. + // AniWorld.SeriesManager.updateSingleSeries() expects this flat object. + if (data && data.key && AniWorld.SeriesManager && AniWorld.SeriesManager.updateSingleSeries) { + AniWorld.SeriesManager.updateSingleSeries(data); } else { // Fallback to full reload if data is incomplete - console.warn('Incomplete series update data, falling back to full reload'); + console.warn('Incomplete series update data, falling back to full reload', data); if (AniWorld.SeriesManager && AniWorld.SeriesManager.loadSeries) { AniWorld.SeriesManager.loadSeries(); } diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..7518fc9 --- /dev/null +++ b/uv.lock @@ -0,0 +1,3 @@ +version = 1 +revision = 3 +requires-python = ">=3.12"