ItemTypeLookup.cs 3.2 KB

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