mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
Fix compilation errors in favorite-to-keep and file cache features
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user