mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-10-26 16:45:09 +00:00
Merge pull request #18132 from mm-workspace/fix-channel-item-type-name
Fix the item type name of BaseItemKind.Channel
This commit is contained in:
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.");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user