mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-04-27 12:02:51 -04:00
v1.4.1: MAJOR FIX - Moved from Redis to Valkey, added migration service to support, Utilizing Hi-Fi API 2.7 with ISRC search, preserve local item json objects, add a quality fallback, added "transcoding" support that just reduces the fetched quality, while still downloading at the quality set in the .env, introduced real-time download visualizer on web-ui (not complete), move some stuff from json to redis, better retry logic, configurable timeouts per provider
This commit is contained in:
@@ -3,6 +3,7 @@ using Moq;
|
||||
using allstarr.Models.Domain;
|
||||
using allstarr.Models.Search;
|
||||
using allstarr.Models.Subsonic;
|
||||
using allstarr.Services.Common;
|
||||
using allstarr.Services.Jellyfin;
|
||||
using System.Text.Json;
|
||||
|
||||
@@ -220,6 +221,35 @@ public class JellyfinModelMapperTests
|
||||
Assert.Equal("Main Artist", song.Artist);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseSong_PreservesRawJellyfinItemSnapshot()
|
||||
{
|
||||
var json = @"{
|
||||
""Id"": ""song-abc"",
|
||||
""Name"": ""Test Song"",
|
||||
""Type"": ""Audio"",
|
||||
""Album"": ""Test Album"",
|
||||
""AlbumId"": ""album-123"",
|
||||
""RunTimeTicks"": 2450000000,
|
||||
""Artists"": [""Test Artist""],
|
||||
""MediaSources"": [
|
||||
{
|
||||
""Id"": ""song-abc"",
|
||||
""RunTimeTicks"": 2450000000
|
||||
}
|
||||
]
|
||||
}";
|
||||
var element = JsonDocument.Parse(json).RootElement;
|
||||
|
||||
var song = _mapper.ParseSong(element);
|
||||
|
||||
Assert.True(JellyfinItemSnapshotHelper.TryGetClonedRawItemSnapshot(song, out var rawItem));
|
||||
Assert.Equal("song-abc", ((JsonElement)rawItem["Id"]!).GetString());
|
||||
Assert.Equal(2450000000L, ((JsonElement)rawItem["RunTimeTicks"]!).GetInt64());
|
||||
Assert.NotNull(song.JellyfinMetadata);
|
||||
Assert.True(song.JellyfinMetadata!.ContainsKey("MediaSources"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseAlbum_ExtractsArtistId_FromAlbumArtists()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user