#nullable disable using System; using System.Collections.Generic; using System.Threading.Tasks; using Jellyfin.Data.Enums; using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Querying; namespace MediaBrowser.Controller.Persistence; /// /// Provides an interface to implement an Item repository. /// public interface IItemRepository { /// /// Retrieves the item. /// /// The id. /// BaseItem. BaseItem RetrieveItem(Guid id); /// /// Gets the items. /// /// The query. /// QueryResult<BaseItem>. QueryResult GetItems(InternalItemsQuery filter); /// /// Gets the item ids list. /// /// The query. /// List<Guid>. IReadOnlyList GetItemIdsList(InternalItemsQuery filter); /// /// Gets the item list. /// /// The query. /// List<BaseItem>. IReadOnlyList GetItemList(InternalItemsQuery filter); /// /// Gets the item list. Used mainly by the Latest api endpoint. /// /// The query. /// Collection Type. /// List<BaseItem>. IReadOnlyList GetLatestItemList(InternalItemsQuery filter, CollectionType collectionType); /// /// Checks if an item has been persisted to the database. /// /// The id to check. /// True if the item exists, otherwise false. Task ItemExistsAsync(Guid id); /// /// Gets genres with item counts. /// /// The query filter. /// The genres and their item counts. QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetGenres(InternalItemsQuery filter); /// /// Gets music genres with item counts. /// /// The query filter. /// The music genres and their item counts. QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetMusicGenres(InternalItemsQuery filter); /// /// Gets studios with item counts. /// /// The query filter. /// The studios and their item counts. QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetStudios(InternalItemsQuery filter); /// /// Gets artists with item counts. /// /// The query filter. /// The artists and their item counts. QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetArtists(InternalItemsQuery filter); /// /// Gets album artists with item counts. /// /// The query filter. /// The album artists and their item counts. QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAlbumArtists(InternalItemsQuery filter); /// /// Gets all artists with item counts. /// /// The query filter. /// All artists and their item counts. QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAllArtists(InternalItemsQuery filter); /// /// Gets all music genre names. /// /// The list of music genre names. IReadOnlyList GetMusicGenreNames(); /// /// Gets all studio names. /// /// The list of studio names. IReadOnlyList GetStudioNames(); /// /// Gets all genre names. /// /// The list of genre names. IReadOnlyList GetGenreNames(); /// /// Gets all artist names. /// /// The list of artist names. IReadOnlyList GetAllArtistNames(); /// /// Gets legacy query filters aggregated from the database. /// /// The query filter. /// Aggregated filter values. QueryFiltersLegacy GetQueryFiltersLegacy(InternalItemsQuery filter); /// /// Gets whether all children of the requested item have been played. /// /// The user to check against. /// The top item id to check. /// Whether the check should be done recursively. /// A value indicating whether all children have been played. bool GetIsPlayed(User user, Guid id, bool recursive); }