diff --git a/src-tauri/src/repository/types.rs b/src-tauri/src/repository/types.rs index 32c2a72..3f9a5f6 100644 --- a/src-tauri/src/repository/types.rs +++ b/src-tauri/src/repository/types.rs @@ -405,15 +405,21 @@ mod tests { #[test] fn test_artist_item_serialize() { - // Test that ArtistItem serializes to PascalCase for consistency + // ArtistItem serializes to camelCase for the frontend; it still accepts + // Jellyfin's PascalCase on deserialize via #[serde(alias = ...)]. let artist = ArtistItem { id: "test-id".to_string(), name: "Test Artist".to_string(), }; let json = serde_json::to_string(&artist).expect("Failed to serialize"); - assert!(json.contains(r#""Id":"test-id""#)); - assert!(json.contains(r#""Name":"Test Artist""#)); + assert!(json.contains(r#""id":"test-id""#)); + assert!(json.contains(r#""name":"Test Artist""#)); + + let from_pascal: ArtistItem = + serde_json::from_str(r#"{"Id":"x","Name":"Y"}"#).expect("Failed to deserialize"); + assert_eq!(from_pascal.id, "x"); + assert_eq!(from_pascal.name, "Y"); } #[test] diff --git a/src/lib/components/common/CachedImage.svelte b/src/lib/components/common/CachedImage.svelte index 55fc67e..98133e8 100644 --- a/src/lib/components/common/CachedImage.svelte +++ b/src/lib/components/common/CachedImage.svelte @@ -6,7 +6,7 @@ interface Props { itemId: string; imageType?: string; - tag?: string; + tag?: string | null; maxWidth?: number; maxHeight?: number; class?: string; diff --git a/src/lib/components/library/CastSection.svelte b/src/lib/components/library/CastSection.svelte index 0498b31..2948b43 100644 --- a/src/lib/components/library/CastSection.svelte +++ b/src/lib/components/library/CastSection.svelte @@ -28,6 +28,7 @@ continue; } const type = person.type; + if (!type) continue; if (type in groups) { groups[type].push(person); } else { @@ -84,7 +85,7 @@
{#each filteredPeople as person, index (person.id)}