ItemTypeLookup.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System.Collections.Frozen;
  2. using System.Collections.Generic;
  3. using System.Threading.Channels;
  4. using Emby.Server.Implementations.Playlists;
  5. using Jellyfin.Data.Enums;
  6. using MediaBrowser.Controller.Entities;
  7. using MediaBrowser.Controller.Entities.Audio;
  8. using MediaBrowser.Controller.Entities.Movies;
  9. using MediaBrowser.Controller.Entities.TV;
  10. using MediaBrowser.Controller.LiveTv;
  11. using MediaBrowser.Controller.Persistence;
  12. using MediaBrowser.Controller.Playlists;
  13. namespace Emby.Server.Implementations.Data;
  14. /// <inheritdoc />
  15. public class ItemTypeLookup : IItemTypeLookup
  16. {
  17. /// <inheritdoc />
  18. public IReadOnlyList<string> MusicGenreTypes { get; } = [
  19. typeof(Audio).FullName!,
  20. typeof(MusicVideo).FullName!,
  21. typeof(MusicAlbum).FullName!,
  22. typeof(MusicArtist).FullName!,
  23. ];
  24. /// <inheritdoc />
  25. public IReadOnlyDictionary<BaseItemKind, string> BaseItemKindNames { get; } = new Dictionary<BaseItemKind, string>()
  26. {
  27. { BaseItemKind.AggregateFolder, typeof(AggregateFolder).FullName! },
  28. { BaseItemKind.Audio, typeof(Audio).FullName! },
  29. { BaseItemKind.AudioBook, typeof(AudioBook).FullName! },
  30. { BaseItemKind.BasePluginFolder, typeof(BasePluginFolder).FullName! },
  31. { BaseItemKind.Book, typeof(Book).FullName! },
  32. { BaseItemKind.BoxSet, typeof(BoxSet).FullName! },
  33. { BaseItemKind.Channel, typeof(Channel).FullName! },
  34. { BaseItemKind.CollectionFolder, typeof(CollectionFolder).FullName! },
  35. { BaseItemKind.Episode, typeof(Episode).FullName! },
  36. { BaseItemKind.Folder, typeof(Folder).FullName! },
  37. { BaseItemKind.Genre, typeof(Genre).FullName! },
  38. { BaseItemKind.Movie, typeof(Movie).FullName! },
  39. { BaseItemKind.LiveTvChannel, typeof(LiveTvChannel).FullName! },
  40. { BaseItemKind.LiveTvProgram, typeof(LiveTvProgram).FullName! },
  41. { BaseItemKind.MusicAlbum, typeof(MusicAlbum).FullName! },
  42. { BaseItemKind.MusicArtist, typeof(MusicArtist).FullName! },
  43. { BaseItemKind.MusicGenre, typeof(MusicGenre).FullName! },
  44. { BaseItemKind.MusicVideo, typeof(MusicVideo).FullName! },
  45. { BaseItemKind.Person, typeof(Person).FullName! },
  46. { BaseItemKind.Photo, typeof(Photo).FullName! },
  47. { BaseItemKind.PhotoAlbum, typeof(PhotoAlbum).FullName! },
  48. { BaseItemKind.Playlist, typeof(Playlist).FullName! },
  49. { BaseItemKind.PlaylistsFolder, typeof(PlaylistsFolder).FullName! },
  50. { BaseItemKind.Season, typeof(Season).FullName! },
  51. { BaseItemKind.Series, typeof(Series).FullName! },
  52. { BaseItemKind.Studio, typeof(Studio).FullName! },
  53. { BaseItemKind.Trailer, typeof(Trailer).FullName! },
  54. { BaseItemKind.TvChannel, typeof(LiveTvChannel).FullName! },
  55. { BaseItemKind.TvProgram, typeof(LiveTvProgram).FullName! },
  56. { BaseItemKind.UserRootFolder, typeof(UserRootFolder).FullName! },
  57. { BaseItemKind.UserView, typeof(UserView).FullName! },
  58. { BaseItemKind.Video, typeof(Video).FullName! },
  59. { BaseItemKind.Year, typeof(Year).FullName! }
  60. }.ToFrozenDictionary();
  61. }