Backport pull request #18132 from jellyfin/release-12.z

Fix the item type name of BaseItemKind.Channel

Original-merge: 4a2d7aa0be

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
martimarkov authored and Cody Robibero committed 2026-09-27 16:30:47 -04:00
1 parent 017f9ba465
commit 764d5df15e
2 files changed
+27 -1

No files matched your search

@@ -1,8 +1,8 @@
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Threading.Channels;
using Emby.Server.Implementations.Playlists;
using Jellyfin.Data.Enums;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies;
@@ -0,0 +1,26 @@
using System;
using System.Linq;
using Emby.Server.Implementations.Data;
using Jellyfin.Data.Enums;
using MediaBrowser.Controller.Entities;
using Xunit;
namespace Jellyfin.Server.Implementations.Tests.Data;
public class ItemTypeLookupTests
{
public static TheoryData<BaseItemKind> MappedKinds()
=> new(new ItemTypeLookup().BaseItemKindNames.Keys);
[Theory]
[MemberData(nameof(MappedKinds))]
public void BaseItemKindNames_Kind_NamesAnItemType(BaseItemKind kind)
{
var name = new ItemTypeLookup().BaseItemKindNames[kind];
var type = AppDomain.CurrentDomain.GetAssemblies().Select(a => a.GetType(name)).FirstOrDefault(t => t is not null);
Assert.NotNull(type);
Assert.True(typeof(BaseItem).IsAssignableFrom(type), $"{name} is not an item type.");
}
}