v1.3.0: Massive WebUI cleanup, Fixed/Stabilized scrobbling, Significant security hardening, added user login to WebUI, refactored searching/interleaving to work MUCH better, Tidal Powered recommendations for SquidWTF provider, Fixed double scrobbling, inferring stops much better, fixed playlist cron rebuilding, stale injected playlist artwork, and search cache TTL
Docker Build & Push / build-and-test (push) Has been cancelled
Docker Build & Push / docker (push) Has been cancelled

This commit is contained in:
2026-03-06 01:59:30 -05:00
parent dfac3c4d60
commit 48b40f89c0
127 changed files with 18679 additions and 7254 deletions
@@ -0,0 +1,58 @@
using System.Text.Json;
using allstarr.Services.Common;
namespace allstarr.Tests;
public class ProviderIdsEnricherTests
{
[Fact]
public void EnsureSpotifyProviderIds_WhenProviderIdsMissing_AddsSpotifyKeys()
{
var item = new Dictionary<string, object?>
{
["Name"] = "As the World Caves In",
["ProviderIds"] = null
};
ProviderIdsEnricher.EnsureSpotifyProviderIds(item, "2xXNLutYAOELYVObYb1C1S", "album-123");
var providerIds = Assert.IsType<Dictionary<string, string>>(item["ProviderIds"]);
Assert.Equal("2xXNLutYAOELYVObYb1C1S", providerIds["Spotify"]);
Assert.Equal("album-123", providerIds["SpotifyAlbum"]);
}
[Fact]
public void EnsureSpotifyProviderIds_WhenProviderIdsJsonElement_PreservesAndAdds()
{
using var doc = JsonDocument.Parse("""{"Jellyfin":"cde0216ad42ece9b66e2626a744e8283"}""");
var item = new Dictionary<string, object?>
{
["ProviderIds"] = doc.RootElement.Clone()
};
ProviderIdsEnricher.EnsureSpotifyProviderIds(item, "2xXNLutYAOELYVObYb1C1S", null);
var providerIds = Assert.IsType<Dictionary<string, string>>(item["ProviderIds"]);
Assert.Equal("cde0216ad42ece9b66e2626a744e8283", providerIds["Jellyfin"]);
Assert.Equal("2xXNLutYAOELYVObYb1C1S", providerIds["Spotify"]);
}
[Fact]
public void EnsureSpotifyProviderIds_WhenSpotifyAlreadyExists_DoesNotOverwrite()
{
var providerIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
["Spotify"] = "existing-spid"
};
var item = new Dictionary<string, object?>
{
["ProviderIds"] = providerIds
};
ProviderIdsEnricher.EnsureSpotifyProviderIds(item, "new-spid", "album-1");
var normalized = Assert.IsType<Dictionary<string, string>>(item["ProviderIds"]);
Assert.Equal("existing-spid", normalized["Spotify"]);
Assert.Equal("album-1", normalized["SpotifyAlbum"]);
}
}