jellyfin/MediaBrowser.Controller/Persistence/IItemRepository.cs

182 lines
6.8 KiB
C#
Raw Normal View History

2013-02-20 18:33:05 -07:00
using MediaBrowser.Controller.Entities;
2013-06-17 13:35:43 -07:00
using MediaBrowser.Model.Entities;
2013-02-20 18:33:05 -07:00
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
2016-06-17 06:06:13 -07:00
using MediaBrowser.Model.Dto;
2015-06-01 07:49:23 -07:00
using MediaBrowser.Model.Querying;
2013-02-20 18:33:05 -07:00
namespace MediaBrowser.Controller.Persistence
{
/// <summary>
/// Provides an interface to implement an Item repository
/// </summary>
public interface IItemRepository : IRepository
{
/// <summary>
/// Saves an item
/// </summary>
/// <param name="item">The item.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SaveItem(BaseItem item, CancellationToken cancellationToken);
2014-02-19 11:50:37 -07:00
/// <summary>
/// Deletes the item.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task DeleteItem(Guid id, CancellationToken cancellationToken);
2014-10-22 21:26:01 -07:00
/// <summary>
/// Gets the critic reviews.
/// </summary>
/// <param name="itemId">The item id.</param>
/// <returns>Task{IEnumerable{ItemReview}}.</returns>
2013-09-17 08:14:22 -07:00
IEnumerable<ItemReview> GetCriticReviews(Guid itemId);
/// <summary>
/// Saves the critic reviews.
/// </summary>
/// <param name="itemId">The item id.</param>
/// <param name="criticReviews">The critic reviews.</param>
/// <returns>Task.</returns>
Task SaveCriticReviews(Guid itemId, IEnumerable<ItemReview> criticReviews);
2013-05-23 08:39:48 -07:00
/// <summary>
/// Saves the items.
/// </summary>
/// <param name="items">The items.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SaveItems(IEnumerable<BaseItem> items, CancellationToken cancellationToken);
2013-06-17 13:35:43 -07:00
/// <summary>
/// Retrieves the item.
/// </summary>
/// <param name="id">The id.</param>
/// <returns>BaseItem.</returns>
2013-06-26 09:08:16 -07:00
BaseItem RetrieveItem(Guid id);
2013-06-18 12:16:27 -07:00
/// <summary>
/// Gets chapters for an item
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
IEnumerable<ChapterInfo> GetChapters(Guid id);
/// <summary>
/// Gets a single chapter for an item
/// </summary>
/// <param name="id"></param>
/// <param name="index"></param>
/// <returns></returns>
ChapterInfo GetChapter(Guid id, int index);
/// <summary>
/// Saves the chapters.
/// </summary>
/// <param name="id">The id.</param>
/// <param name="chapters">The chapters.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
2016-06-11 13:12:01 -07:00
Task SaveChapters(Guid id, List<ChapterInfo> chapters, CancellationToken cancellationToken);
2013-12-05 20:39:44 -07:00
/// <summary>
/// Gets the media streams.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>IEnumerable{MediaStream}.</returns>
IEnumerable<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>
/// <returns>Task.</returns>
2016-06-11 13:12:01 -07:00
Task SaveMediaStreams(Guid id, List<MediaStream> streams, CancellationToken cancellationToken);
2015-04-15 20:23:13 -07:00
/// <summary>
2015-06-01 07:49:23 -07:00
/// Gets the item ids.
2015-04-15 20:23:13 -07:00
/// </summary>
2015-06-01 07:49:23 -07:00
/// <param name="query">The query.</param>
/// <returns>IEnumerable&lt;Guid&gt;.</returns>
QueryResult<Guid> GetItemIds(InternalItemsQuery query);
/// <summary>
/// Gets the items.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;BaseItem&gt;.</returns>
QueryResult<BaseItem> GetItems(InternalItemsQuery query);
/// <summary>
/// Gets the item ids list.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>List&lt;Guid&gt;.</returns>
List<Guid> GetItemIdsList(InternalItemsQuery query);
2015-06-28 18:10:45 -07:00
/// <summary>
/// Gets the people.
/// </summary>
2015-07-08 09:10:34 -07:00
/// <param name="query">The query.</param>
2015-06-28 18:10:45 -07:00
/// <returns>List&lt;PersonInfo&gt;.</returns>
2015-07-08 09:10:34 -07:00
List<PersonInfo> GetPeople(InternalPeopleQuery query);
2015-06-28 18:10:45 -07:00
/// <summary>
/// Updates the people.
/// </summary>
/// <param name="itemId">The item identifier.</param>
/// <param name="people">The people.</param>
/// <returns>Task.</returns>
Task UpdatePeople(Guid itemId, List<PersonInfo> people);
2015-07-06 19:25:23 -07:00
/// <summary>
/// Gets the people names.
/// </summary>
2015-07-08 09:10:34 -07:00
/// <param name="query">The query.</param>
2015-07-06 19:25:23 -07:00
/// <returns>List&lt;System.String&gt;.</returns>
2015-07-08 09:10:34 -07:00
List<string> GetPeopleNames(InternalPeopleQuery query);
2015-09-16 10:16:39 -07:00
/// <summary>
/// Gets the item ids with path.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult&lt;Tuple&lt;Guid, System.String&gt;&gt;.</returns>
QueryResult<Tuple<Guid, string>> GetItemIdsWithPath(InternalItemsQuery query);
2015-10-29 06:28:05 -07:00
/// <summary>
/// Gets the item list.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>List&lt;BaseItem&gt;.</returns>
List<BaseItem> GetItemList(InternalItemsQuery query);
2015-11-02 10:25:01 -07:00
/// <summary>
/// Updates the inherited values.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task UpdateInheritedValues(CancellationToken cancellationToken);
2016-06-17 06:06:13 -07:00
QueryResult<Tuple<BaseItem, ItemCounts>> GetGenres(InternalItemsQuery query);
QueryResult<Tuple<BaseItem, ItemCounts>> GetMusicGenres(InternalItemsQuery query);
QueryResult<Tuple<BaseItem, ItemCounts>> GetGameGenres(InternalItemsQuery query);
QueryResult<Tuple<BaseItem, ItemCounts>> GetStudios(InternalItemsQuery query);
QueryResult<Tuple<BaseItem, ItemCounts>> GetArtists(InternalItemsQuery query);
QueryResult<Tuple<BaseItem, ItemCounts>> GetAlbumArtists(InternalItemsQuery query);
2016-08-05 21:38:01 -07:00
QueryResult<Tuple<BaseItem, ItemCounts>> GetAllArtists(InternalItemsQuery query);
2016-08-18 08:13:18 -07:00
2016-08-18 22:58:35 -07:00
List<string> GetGameGenreNames();
List<string> GetMusicGenreNames();
2016-08-18 08:13:18 -07:00
List<string> GetStudioNames();
2016-08-18 22:58:35 -07:00
List<string> GetGenreNames();
2016-08-18 08:13:18 -07:00
List<string> GetAllArtistNames();
2013-02-20 18:33:05 -07:00
}
}
2013-06-17 13:35:43 -07:00