Fix manual mapping race condition and add log gitignore

This commit is contained in:
2026-02-04 19:17:48 -05:00
parent 030937b196
commit cf1428d678
2 changed files with 12 additions and 12 deletions

3
.gitignore vendored
View File

@@ -88,6 +88,9 @@ apis/*.md
apis/*.json
!apis/jellyfin-openapi-stable.json
# Log files for debugging
apis/*.log
# Endpoint usage tracking
apis/endpoint-usage.json
/app/cache/endpoint-usage/

View File

@@ -841,19 +841,16 @@ public class AdminController : ControllerBase
{
_logger.LogInformation("Triggering immediate playlist rebuild for {Playlist} with new manual mapping", decodedName);
// Run in background so we don't block the response
_ = Task.Run(async () =>
// Wait for the rebuild to complete before responding to ensure UI gets updated cache
try
{
try
{
await _matchingService.TriggerMatchingForPlaylistAsync(decodedName);
_logger.LogInformation("✓ Playlist {Playlist} rebuilt successfully with manual mapping", decodedName);
}
catch (Exception ex)
{
_logger.LogError(ex, "Failed to rebuild playlist {Playlist} after manual mapping", decodedName);
}
});
await _matchingService.TriggerMatchingForPlaylistAsync(decodedName);
_logger.LogInformation("✓ Playlist {Playlist} rebuilt successfully with manual mapping", decodedName);
}
catch (Exception ex)
{
_logger.LogError(ex, "Failed to rebuild playlist {Playlist} after manual mapping", decodedName);
}
}
else
{