Fix compilation errors in favorite-to-keep and file cache features

This commit is contained in:
2026-02-01 11:14:18 -05:00
parent 449bcc2561
commit 027aeab969
2 changed files with 11 additions and 16 deletions

View File

@@ -2110,23 +2110,18 @@ public class JellyfinController : ControllerBase
return;
}
// Check if file exists in downloads folder
var downloadPath = PathHelper.GetSongPath(song.Artist, song.Album, song.Title);
if (!System.IO.File.Exists(downloadPath))
// Trigger download first
_logger.LogInformation("Downloading track for kept folder: {ItemId}", itemId);
var downloadResult = await _downloadService.DownloadSongAsync(provider, externalId);
if (!downloadResult.IsSuccess)
{
_logger.LogInformation("Track not yet downloaded, triggering download for {ItemId}", itemId);
// Download the track first
var downloadResult = await _downloadService.DownloadSongAsync(provider, externalId);
if (!downloadResult.IsSuccess)
{
_logger.LogWarning("Failed to download track {ItemId}: {Error}", itemId, downloadResult.Error);
return;
}
downloadPath = downloadResult.Value!.FilePath;
_logger.LogWarning("Failed to download track {ItemId}: {Error}", itemId, downloadResult.Error);
return;
}
var downloadPath = downloadResult.Value!.FilePath;
// Create kept folder structure: /app/kept/Artist/Album/
var keptBasePath = "/app/kept";
var keptArtistPath = Path.Combine(keptBasePath, PathHelper.SanitizeFileName(song.Artist));

View File

@@ -142,8 +142,8 @@ public class SpotifyMissingTracksFetcher : BackgroundService
playlistName, fileAge.TotalHours);
// Load from file into Redis if not already there
var cacheKey = $"spotify:missing:{playlistName}";
if (!await _cache.ExistsAsync(cacheKey))
var key = $"spotify:missing:{playlistName}";
if (!await _cache.ExistsAsync(key))
{
await LoadFromFileCache(playlistName);
}