ItemTypeLookup.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading.Channels;
  4. using Emby.Server.Implementations.Playlists;
  5. using Jellyfin.Data.Enums;
  6. using Jellyfin.Server.Implementations;
  7. using MediaBrowser.Controller.Entities;
  8. using MediaBrowser.Controller.Entities.Audio;
  9. using MediaBrowser.Controller.Entities.Movies;
  10. using MediaBrowser.Controller.Entities.TV;
  11. using MediaBrowser.Controller.LiveTv;
  12. using MediaBrowser.Controller.Persistence;
  13. using MediaBrowser.Controller.Playlists;
  14. using MediaBrowser.Model.Querying;
  15. namespace Emby.Server.Implementations.Data;
  16. /// <inheritdoc />
  17. public class ItemTypeLookup : IItemTypeLookup
  18. {
  19. /// <inheritdoc />
  20. public IReadOnlyList<ItemFields> AllItemFields { get; } = Enum.GetValues<ItemFields>();
  21. /// <inheritdoc />
  22. public IReadOnlyList<BaseItemKind> ProgramTypes { get; } =
  23. [
  24. BaseItemKind.Program,
  25. BaseItemKind.TvChannel,
  26. BaseItemKind.LiveTvProgram,
  27. BaseItemKind.LiveTvChannel
  28. ];
  29. /// <inheritdoc />
  30. public IReadOnlyList<BaseItemKind> ProgramExcludeParentTypes { get; } =
  31. [
  32. BaseItemKind.Series,
  33. BaseItemKind.Season,
  34. BaseItemKind.MusicAlbum,
  35. BaseItemKind.MusicArtist,
  36. BaseItemKind.PhotoAlbum
  37. ];
  38. /// <inheritdoc />
  39. public IReadOnlyList<BaseItemKind> ServiceTypes { get; } =
  40. [
  41. BaseItemKind.TvChannel,
  42. BaseItemKind.LiveTvChannel
  43. ];
  44. /// <inheritdoc />
  45. public IReadOnlyList<BaseItemKind> StartDateTypes { get; } =
  46. [
  47. BaseItemKind.Program,
  48. BaseItemKind.LiveTvProgram
  49. ];
  50. /// <inheritdoc />
  51. public IReadOnlyList<BaseItemKind> SeriesTypes { get; } =
  52. [
  53. BaseItemKind.Book,
  54. BaseItemKind.AudioBook,
  55. BaseItemKind.Episode,
  56. BaseItemKind.Season
  57. ];
  58. /// <inheritdoc />
  59. public IReadOnlyList<BaseItemKind> ArtistExcludeParentTypes { get; } =
  60. [
  61. BaseItemKind.Series,
  62. BaseItemKind.Season,
  63. BaseItemKind.PhotoAlbum
  64. ];
  65. /// <inheritdoc />
  66. public IReadOnlyList<BaseItemKind> ArtistsTypes { get; } =
  67. [
  68. BaseItemKind.Audio,
  69. BaseItemKind.MusicAlbum,
  70. BaseItemKind.MusicVideo,
  71. BaseItemKind.AudioBook
  72. ];
  73. /// <inheritdoc />
  74. public IDictionary<BaseItemKind, string?> BaseItemKindNames { get; } = new Dictionary<BaseItemKind, string?>()
  75. {
  76. { BaseItemKind.AggregateFolder, typeof(AggregateFolder).FullName },
  77. { BaseItemKind.Audio, typeof(Audio).FullName },
  78. { BaseItemKind.AudioBook, typeof(AudioBook).FullName },
  79. { BaseItemKind.BasePluginFolder, typeof(BasePluginFolder).FullName },
  80. { BaseItemKind.Book, typeof(Book).FullName },
  81. { BaseItemKind.BoxSet, typeof(BoxSet).FullName },
  82. { BaseItemKind.Channel, typeof(Channel).FullName },
  83. { BaseItemKind.CollectionFolder, typeof(CollectionFolder).FullName },
  84. { BaseItemKind.Episode, typeof(Episode).FullName },
  85. { BaseItemKind.Folder, typeof(Folder).FullName },
  86. { BaseItemKind.Genre, typeof(Genre).FullName },
  87. { BaseItemKind.Movie, typeof(Movie).FullName },
  88. { BaseItemKind.LiveTvChannel, typeof(LiveTvChannel).FullName },
  89. { BaseItemKind.LiveTvProgram, typeof(LiveTvProgram).FullName },
  90. { BaseItemKind.MusicAlbum, typeof(MusicAlbum).FullName },
  91. { BaseItemKind.MusicArtist, typeof(MusicArtist).FullName },
  92. { BaseItemKind.MusicGenre, typeof(MusicGenre).FullName },
  93. { BaseItemKind.MusicVideo, typeof(MusicVideo).FullName },
  94. { BaseItemKind.Person, typeof(Person).FullName },
  95. { BaseItemKind.Photo, typeof(Photo).FullName },
  96. { BaseItemKind.PhotoAlbum, typeof(PhotoAlbum).FullName },
  97. { BaseItemKind.Playlist, typeof(Playlist).FullName },
  98. { BaseItemKind.PlaylistsFolder, typeof(PlaylistsFolder).FullName },
  99. { BaseItemKind.Season, typeof(Season).FullName },
  100. { BaseItemKind.Series, typeof(Series).FullName },
  101. { BaseItemKind.Studio, typeof(Studio).FullName },
  102. { BaseItemKind.Trailer, typeof(Trailer).FullName },
  103. { BaseItemKind.TvChannel, typeof(LiveTvChannel).FullName },
  104. { BaseItemKind.TvProgram, typeof(LiveTvProgram).FullName },
  105. { BaseItemKind.UserRootFolder, typeof(UserRootFolder).FullName },
  106. { BaseItemKind.UserView, typeof(UserView).FullName },
  107. { BaseItemKind.Video, typeof(Video).FullName },
  108. { BaseItemKind.Year, typeof(Year).FullName }
  109. }.AsReadOnly();
  110. }