mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-11 00:18:38 -05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
d0a7dbcc96
|
|||
|
9c9a827a91
|
@@ -3529,8 +3529,17 @@ public class JellyfinController : ControllerBase
|
||||
return null; // Fall back to legacy mode
|
||||
}
|
||||
|
||||
// Request MediaSources field to get bitrate info
|
||||
var playlistItemsUrl = $"Playlists/{playlistId}/Items?UserId={userId}&Fields=MediaSources";
|
||||
// Pass through all requested fields from the original request
|
||||
var queryString = Request.QueryString.Value ?? "";
|
||||
var playlistItemsUrl = $"Playlists/{playlistId}/Items?UserId={userId}";
|
||||
|
||||
// Append the original query string (which includes Fields parameter)
|
||||
if (!string.IsNullOrEmpty(queryString))
|
||||
{
|
||||
// Remove the leading ? if present
|
||||
queryString = queryString.TrimStart('?');
|
||||
playlistItemsUrl = $"{playlistItemsUrl}&{queryString}";
|
||||
}
|
||||
|
||||
_logger.LogInformation("🔍 Fetching existing tracks from Jellyfin playlist {PlaylistId} with UserId {UserId}",
|
||||
playlistId, userId);
|
||||
|
||||
@@ -16,13 +16,13 @@ public class DeezerMetadataService : IMusicMetadataService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly SubsonicSettings _settings;
|
||||
private readonly GenreEnrichmentService _genreEnrichment;
|
||||
private readonly GenreEnrichmentService? _genreEnrichment;
|
||||
private const string BaseUrl = "https://api.deezer.com";
|
||||
|
||||
public DeezerMetadataService(
|
||||
IHttpClientFactory httpClientFactory,
|
||||
IOptions<SubsonicSettings> settings,
|
||||
GenreEnrichmentService genreEnrichment)
|
||||
GenreEnrichmentService? genreEnrichment = null)
|
||||
{
|
||||
_httpClient = httpClientFactory.CreateClient();
|
||||
_settings = settings.Value;
|
||||
@@ -210,7 +210,7 @@ public class DeezerMetadataService : IMusicMetadataService
|
||||
}
|
||||
|
||||
// Enrich with MusicBrainz genres if missing
|
||||
if (string.IsNullOrEmpty(song.Genre))
|
||||
if (_genreEnrichment != null && string.IsNullOrEmpty(song.Genre))
|
||||
{
|
||||
await _genreEnrichment.EnrichSongGenreAsync(song);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public class QobuzMetadataService : IMusicMetadataService
|
||||
private readonly SubsonicSettings _settings;
|
||||
private readonly QobuzBundleService _bundleService;
|
||||
private readonly ILogger<QobuzMetadataService> _logger;
|
||||
private readonly GenreEnrichmentService _genreEnrichment;
|
||||
private readonly GenreEnrichmentService? _genreEnrichment;
|
||||
private readonly string? _userAuthToken;
|
||||
private readonly string? _userId;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class QobuzMetadataService : IMusicMetadataService
|
||||
IOptions<QobuzSettings> qobuzSettings,
|
||||
QobuzBundleService bundleService,
|
||||
ILogger<QobuzMetadataService> logger,
|
||||
GenreEnrichmentService genreEnrichment)
|
||||
GenreEnrichmentService? genreEnrichment = null)
|
||||
{
|
||||
_httpClient = httpClientFactory.CreateClient();
|
||||
_settings = settings.Value;
|
||||
@@ -184,7 +184,7 @@ public class QobuzMetadataService : IMusicMetadataService
|
||||
var song = ParseQobuzTrackFull(track);
|
||||
|
||||
// Enrich with MusicBrainz genres if missing
|
||||
if (song != null && string.IsNullOrEmpty(song.Genre))
|
||||
if (_genreEnrichment != null && song != null && string.IsNullOrEmpty(song.Genre))
|
||||
{
|
||||
await _genreEnrichment.EnrichSongGenreAsync(song);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
||||
private readonly ILogger<SquidWTFMetadataService> _logger;
|
||||
private readonly RedisCacheService _cache;
|
||||
private readonly RoundRobinFallbackHelper _fallbackHelper;
|
||||
private readonly GenreEnrichmentService _genreEnrichment;
|
||||
private readonly GenreEnrichmentService? _genreEnrichment;
|
||||
|
||||
public SquidWTFMetadataService(
|
||||
IHttpClientFactory httpClientFactory,
|
||||
@@ -65,7 +65,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
||||
ILogger<SquidWTFMetadataService> logger,
|
||||
RedisCacheService cache,
|
||||
List<string> apiUrls,
|
||||
GenreEnrichmentService genreEnrichment)
|
||||
GenreEnrichmentService? genreEnrichment = null)
|
||||
{
|
||||
_httpClient = httpClientFactory.CreateClient();
|
||||
_settings = settings.Value;
|
||||
@@ -290,7 +290,7 @@ public class SquidWTFMetadataService : IMusicMetadataService
|
||||
var song = ParseTidalTrackFull(track);
|
||||
|
||||
// Enrich with MusicBrainz genres if missing (SquidWTF/Tidal doesn't provide genres)
|
||||
if (string.IsNullOrEmpty(song.Genre))
|
||||
if (_genreEnrichment != null && string.IsNullOrEmpty(song.Genre))
|
||||
{
|
||||
await _genreEnrichment.EnrichSongGenreAsync(song);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>allstarr</RootNamespace>
|
||||
<Version>1.0.0</Version>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<Version>1.2.2</Version>
|
||||
<AssemblyVersion>1.2.2.0</AssemblyVersion>
|
||||
<FileVersion>1.2.2.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user