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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if file exists in downloads folder
|
// Trigger download first
|
||||||
var downloadPath = PathHelper.GetSongPath(song.Artist, song.Album, song.Title);
|
_logger.LogInformation("Downloading track for kept folder: {ItemId}", itemId);
|
||||||
if (!System.IO.File.Exists(downloadPath))
|
var downloadResult = await _downloadService.DownloadSongAsync(provider, externalId);
|
||||||
|
|
||||||
|
if (!downloadResult.IsSuccess)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Track not yet downloaded, triggering download for {ItemId}", itemId);
|
_logger.LogWarning("Failed to download track {ItemId}: {Error}", itemId, downloadResult.Error);
|
||||||
|
return;
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var downloadPath = downloadResult.Value!.FilePath;
|
||||||
|
|
||||||
// Create kept folder structure: /app/kept/Artist/Album/
|
// Create kept folder structure: /app/kept/Artist/Album/
|
||||||
var keptBasePath = "/app/kept";
|
var keptBasePath = "/app/kept";
|
||||||
var keptArtistPath = Path.Combine(keptBasePath, PathHelper.SanitizeFileName(song.Artist));
|
var keptArtistPath = Path.Combine(keptBasePath, PathHelper.SanitizeFileName(song.Artist));
|
||||||
|
|||||||
@@ -142,8 +142,8 @@ public class SpotifyMissingTracksFetcher : BackgroundService
|
|||||||
playlistName, fileAge.TotalHours);
|
playlistName, fileAge.TotalHours);
|
||||||
|
|
||||||
// Load from file into Redis if not already there
|
// Load from file into Redis if not already there
|
||||||
var cacheKey = $"spotify:missing:{playlistName}";
|
var key = $"spotify:missing:{playlistName}";
|
||||||
if (!await _cache.ExistsAsync(cacheKey))
|
if (!await _cache.ExistsAsync(key))
|
||||||
{
|
{
|
||||||
await LoadFromFileCache(playlistName);
|
await LoadFromFileCache(playlistName);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user