2021-05-06 22:39:20 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2020-08-22 19:56:24 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 20:01:16 +00:00
|
|
|
using System;
|
2018-12-27 23:27:57 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading;
|
2019-01-13 19:25:32 +00:00
|
|
|
using MediaBrowser.Controller.Entities;
|
2018-12-27 23:27:57 +00:00
|
|
|
using MediaBrowser.Model.Dto;
|
2019-01-13 19:25:32 +00:00
|
|
|
using MediaBrowser.Model.Entities;
|
2018-12-27 23:27:57 +00:00
|
|
|
using MediaBrowser.Model.Querying;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Persistence
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-06-15 22:37:52 +00:00
|
|
|
/// Provides an interface to implement an Item repository.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
public interface IItemRepository : IRepository
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-06-15 22:37:52 +00:00
|
|
|
/// Saves an item.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
void SaveItem(BaseItem item, CancellationToken cancellationToken);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Deletes the item.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">The identifier.</param>
|
2020-04-03 18:59:38 +00:00
|
|
|
void DeleteItem(Guid id);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the items.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="items">The items.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2019-02-08 23:57:58 +00:00
|
|
|
void SaveItems(IEnumerable<BaseItem> items, CancellationToken cancellationToken);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
void SaveImages(BaseItem item);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Retrieves the item.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">The id.</param>
|
|
|
|
/// <returns>BaseItem.</returns>
|
|
|
|
BaseItem RetrieveItem(Guid id);
|
|
|
|
|
|
|
|
/// <summary>
|
2020-06-15 22:37:52 +00:00
|
|
|
/// Gets chapters for an item.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
List<ChapterInfo> GetChapters(BaseItem id);
|
|
|
|
|
|
|
|
/// <summary>
|
2020-06-15 22:37:52 +00:00
|
|
|
/// Gets a single chapter for an item.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <param name="index"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
ChapterInfo GetChapter(BaseItem id, int index);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the chapters.
|
|
|
|
/// </summary>
|
2020-02-23 09:53:51 +00:00
|
|
|
void SaveChapters(Guid id, IReadOnlyList<ChapterInfo> chapters);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the media streams.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <returns>IEnumerable{MediaStream}.</returns>
|
|
|
|
List<MediaStream> GetMediaStreams(MediaStreamQuery query);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the media streams.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
/// <param name="streams">The streams.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
void SaveMediaStreams(Guid id, List<MediaStream> streams, CancellationToken cancellationToken);
|
|
|
|
|
2019-10-04 17:23:08 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the media attachments.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <returns>IEnumerable{MediaAttachment}.</returns>
|
|
|
|
List<MediaAttachment> GetMediaAttachments(MediaAttachmentQuery query);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the media attachments.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">The identifier.</param>
|
|
|
|
/// <param name="attachments">The attachments.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2019-12-26 22:20:31 +00:00
|
|
|
void SaveMediaAttachments(Guid id, IReadOnlyList<MediaAttachment> attachments, CancellationToken cancellationToken);
|
2019-10-04 17:23:08 +00:00
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the item ids.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <returns>IEnumerable<Guid>.</returns>
|
|
|
|
QueryResult<Guid> GetItemIds(InternalItemsQuery query);
|
2020-09-28 20:04:31 +00:00
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the items.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <returns>QueryResult<BaseItem>.</returns>
|
|
|
|
QueryResult<BaseItem> GetItems(InternalItemsQuery query);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the item ids list.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <returns>List<Guid>.</returns>
|
|
|
|
List<Guid> GetItemIdsList(InternalItemsQuery query);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the people.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <returns>List<PersonInfo>.</returns>
|
|
|
|
List<PersonInfo> GetPeople(InternalPeopleQuery query);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Updates the people.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="itemId">The item identifier.</param>
|
|
|
|
/// <param name="people">The people.</param>
|
|
|
|
void UpdatePeople(Guid itemId, List<PersonInfo> people);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the people names.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <returns>List<System.String>.</returns>
|
|
|
|
List<string> GetPeopleNames(InternalPeopleQuery query);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the item ids with path.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <returns>QueryResult<Tuple<Guid, System.String>>.</returns>
|
|
|
|
List<Tuple<Guid, string>> GetItemIdsWithPath(InternalItemsQuery query);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the item list.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
/// <returns>List<BaseItem>.</returns>
|
|
|
|
List<BaseItem> GetItemList(InternalItemsQuery query);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Updates the inherited values.
|
|
|
|
/// </summary>
|
2021-04-22 13:28:24 +00:00
|
|
|
void UpdateInheritedValues();
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
int GetCount(InternalItemsQuery query);
|
|
|
|
|
2019-02-08 23:48:09 +00:00
|
|
|
QueryResult<(BaseItem, ItemCounts)> GetGenres(InternalItemsQuery query);
|
2020-08-22 19:56:24 +00:00
|
|
|
|
2019-02-08 23:48:09 +00:00
|
|
|
QueryResult<(BaseItem, ItemCounts)> GetMusicGenres(InternalItemsQuery query);
|
2020-08-22 19:56:24 +00:00
|
|
|
|
2019-02-08 23:48:09 +00:00
|
|
|
QueryResult<(BaseItem, ItemCounts)> GetStudios(InternalItemsQuery query);
|
2020-08-22 19:56:24 +00:00
|
|
|
|
2019-02-08 23:48:09 +00:00
|
|
|
QueryResult<(BaseItem, ItemCounts)> GetArtists(InternalItemsQuery query);
|
2020-08-22 19:56:24 +00:00
|
|
|
|
2019-02-08 23:48:09 +00:00
|
|
|
QueryResult<(BaseItem, ItemCounts)> GetAlbumArtists(InternalItemsQuery query);
|
2020-08-22 19:56:24 +00:00
|
|
|
|
2019-02-08 23:48:09 +00:00
|
|
|
QueryResult<(BaseItem, ItemCounts)> GetAllArtists(InternalItemsQuery query);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
List<string> GetMusicGenreNames();
|
2020-08-22 19:56:24 +00:00
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
List<string> GetStudioNames();
|
2020-08-22 19:56:24 +00:00
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
List<string> GetGenreNames();
|
2020-08-22 19:56:24 +00:00
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
List<string> GetAllArtistNames();
|
|
|
|
}
|
|
|
|
}
|