mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
Fix authentication issues in SpotifyTrackMatchingService
- Fixed SpotifyTrackMatchingService to use GetJsonAsyncInternal for authenticated requests - This resolves 401 Unauthorized errors when fetching existing playlist tracks - Should prevent unnecessary rematching when cache is warm - Fixes 'No Items found in Jellyfin playlist response' warnings The service was using GetJsonAsync with null headers, causing 401 errors. Now uses server API key authentication for internal operations.
This commit is contained in:
@@ -241,19 +241,19 @@ public class SpotifyTrackMatchingService : BackgroundService
|
||||
// CRITICAL: Must include UserId parameter or Jellyfin returns empty results
|
||||
var userId = jellyfinSettings.UserId;
|
||||
var playlistItemsUrl = $"Playlists/{playlistConfig.JellyfinId}/Items";
|
||||
var queryParams = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(userId))
|
||||
{
|
||||
playlistItemsUrl += $"?UserId={userId}";
|
||||
queryParams["UserId"] = userId;
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.LogWarning("No UserId configured - may not be able to fetch existing playlist tracks for {Playlist}", playlistName);
|
||||
}
|
||||
|
||||
var (existingTracksResponse, _) = await proxyService.GetJsonAsync(
|
||||
var (existingTracksResponse, _) = await proxyService.GetJsonAsyncInternal(
|
||||
playlistItemsUrl,
|
||||
null,
|
||||
null);
|
||||
queryParams);
|
||||
|
||||
if (existingTracksResponse != null &&
|
||||
existingTracksResponse.RootElement.TryGetProperty("Items", out var items))
|
||||
|
||||
Reference in New Issue
Block a user