2021-05-07 00:39:20 +02:00
|
|
|
#nullable disable
|
|
|
|
|
|
2020-08-22 21:56:24 +02:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
|
2019-01-13 21:01:16 +01:00
|
|
|
using System;
|
2018-12-27 18:27:57 -05:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading;
|
2025-06-16 00:19:57 +03:00
|
|
|
using System.Threading.Tasks;
|
2025-03-27 10:26:47 +08:00
|
|
|
using Jellyfin.Data.Enums;
|
2019-01-13 20:25:32 +01:00
|
|
|
using MediaBrowser.Controller.Entities;
|
2018-12-27 18:27:57 -05:00
|
|
|
using MediaBrowser.Model.Dto;
|
|
|
|
|
using MediaBrowser.Model.Querying;
|
|
|
|
|
|
2024-10-08 19:53:26 +00:00
|
|
|
namespace MediaBrowser.Controller.Persistence;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides an interface to implement an Item repository.
|
|
|
|
|
/// </summary>
|
2025-01-11 18:13:16 +00:00
|
|
|
public interface IItemRepository
|
2018-12-27 18:27:57 -05:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2024-10-08 19:53:26 +00:00
|
|
|
/// Deletes the item.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
|
void DeleteItem(Guid id);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the items.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="items">The items.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
void SaveItems(IReadOnlyList<BaseItem> items, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
|
|
void SaveImages(BaseItem item);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Retrieves the item.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The id.</param>
|
|
|
|
|
/// <returns>BaseItem.</returns>
|
|
|
|
|
BaseItem RetrieveItem(Guid id);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the items.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="filter">The query.</param>
|
|
|
|
|
/// <returns>QueryResult<BaseItem>.</returns>
|
|
|
|
|
QueryResult<BaseItem> GetItems(InternalItemsQuery filter);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the item ids list.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="filter">The query.</param>
|
|
|
|
|
/// <returns>List<Guid>.</returns>
|
|
|
|
|
IReadOnlyList<Guid> GetItemIdsList(InternalItemsQuery filter);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the item list.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="filter">The query.</param>
|
|
|
|
|
/// <returns>List<BaseItem>.</returns>
|
|
|
|
|
IReadOnlyList<BaseItem> GetItemList(InternalItemsQuery filter);
|
|
|
|
|
|
2025-03-27 10:26:47 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the item list. Used mainly by the Latest api endpoint.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="filter">The query.</param>
|
|
|
|
|
/// <param name="collectionType">Collection Type.</param>
|
|
|
|
|
/// <returns>List<BaseItem>.</returns>
|
|
|
|
|
IReadOnlyList<BaseItem> GetLatestItemList(InternalItemsQuery filter, CollectionType collectionType);
|
|
|
|
|
|
2025-03-18 17:37:04 -06:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the list of series presentation keys for next up.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="filter">The query.</param>
|
|
|
|
|
/// <param name="dateCutoff">The minimum date for a series to have been most recently watched.</param>
|
|
|
|
|
/// <returns>The list of keys.</returns>
|
|
|
|
|
IReadOnlyList<string> GetNextUpSeriesKeys(InternalItemsQuery filter, DateTime dateCutoff);
|
|
|
|
|
|
2024-10-08 19:53:26 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Updates the inherited values.
|
2018-12-27 18:27:57 -05:00
|
|
|
/// </summary>
|
2024-10-08 19:53:26 +00:00
|
|
|
void UpdateInheritedValues();
|
|
|
|
|
|
|
|
|
|
int GetCount(InternalItemsQuery filter);
|
|
|
|
|
|
|
|
|
|
QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetGenres(InternalItemsQuery filter);
|
|
|
|
|
|
|
|
|
|
QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetMusicGenres(InternalItemsQuery filter);
|
|
|
|
|
|
|
|
|
|
QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetStudios(InternalItemsQuery filter);
|
|
|
|
|
|
|
|
|
|
QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetArtists(InternalItemsQuery filter);
|
|
|
|
|
|
|
|
|
|
QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAlbumArtists(InternalItemsQuery filter);
|
|
|
|
|
|
|
|
|
|
QueryResult<(BaseItem Item, ItemCounts ItemCounts)> GetAllArtists(InternalItemsQuery filter);
|
|
|
|
|
|
|
|
|
|
IReadOnlyList<string> GetMusicGenreNames();
|
|
|
|
|
|
|
|
|
|
IReadOnlyList<string> GetStudioNames();
|
|
|
|
|
|
|
|
|
|
IReadOnlyList<string> GetGenreNames();
|
|
|
|
|
|
|
|
|
|
IReadOnlyList<string> GetAllArtistNames();
|
2025-06-16 00:19:57 +03:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if an item has been persisted to the database.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">The id to check.</param>
|
|
|
|
|
/// <returns>True if the item exists, otherwise false.</returns>
|
|
|
|
|
Task<bool> ItemExistsAsync(Guid id);
|
2018-12-27 18:27:57 -05:00
|
|
|
}
|