jellyfin-server/MediaBrowser.Controller/Persistence/IItemRepository.cs

173 lines
6.1 KiB
C#
Raw Normal View History

2013-02-21 01:33:05 +00:00
using MediaBrowser.Controller.Entities;
2013-06-17 20:35:43 +00:00
using MediaBrowser.Model.Entities;
2013-02-21 01:33:05 +00:00
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
2015-06-01 14:49:23 +00:00
using MediaBrowser.Model.Querying;
2013-02-21 01:33:05 +00:00
namespace MediaBrowser.Controller.Persistence
{
/// <summary>
/// Provides an interface to implement an Item repository
/// </summary>
public interface IItemRepository : IRepository
{
2013-06-20 16:44:24 +00:00
/// <summary>
/// Opens the connection to the repository
/// </summary>
/// <returns>Task.</returns>
Task Initialize();
2013-02-21 01:33:05 +00:00
/// <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 18:50:37 +00: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-23 04:26:01 +00:00
/// <summary>
/// Gets the critic reviews.
/// </summary>
/// <param name="itemId">The item id.</param>
/// <returns>Task{IEnumerable{ItemReview}}.</returns>
2013-09-17 15:14:22 +00: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 15:39:48 +00: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 20:35:43 +00:00
/// <summary>
/// Retrieves the item.
/// </summary>
/// <param name="id">The id.</param>
/// <returns>BaseItem.</returns>
2013-06-26 16:08:16 +00:00
BaseItem RetrieveItem(Guid id);
2013-06-18 19:16:27 +00: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>
Task SaveChapters(Guid id, IEnumerable<ChapterInfo> chapters, CancellationToken cancellationToken);
2013-12-06 03:39:44 +00: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>
Task SaveMediaStreams(Guid id, IEnumerable<MediaStream> streams, CancellationToken cancellationToken);
2015-04-16 03:23:13 +00:00
/// <summary>
2015-06-01 14:49:23 +00:00
/// Gets the item ids.
2015-04-16 03:23:13 +00:00
/// </summary>
2015-06-01 14:49:23 +00: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-29 01:10:45 +00:00
/// <summary>
/// Gets the people.
/// </summary>
2015-07-08 16:10:34 +00:00
/// <param name="query">The query.</param>
2015-06-29 01:10:45 +00:00
/// <returns>List&lt;PersonInfo&gt;.</returns>
2015-07-08 16:10:34 +00:00
List<PersonInfo> GetPeople(InternalPeopleQuery query);
2015-06-29 01:10:45 +00: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-07 02:25:23 +00:00
/// <summary>
/// Gets the people names.
/// </summary>
2015-07-08 16:10:34 +00:00
/// <param name="query">The query.</param>
2015-07-07 02:25:23 +00:00
/// <returns>List&lt;System.String&gt;.</returns>
2015-07-08 16:10:34 +00:00
List<string> GetPeopleNames(InternalPeopleQuery query);
2015-09-16 17:16:39 +00: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 13:28:05 +00:00
/// <summary>
/// Gets the item list.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>List&lt;BaseItem&gt;.</returns>
IEnumerable<BaseItem> GetItemList(InternalItemsQuery query);
2015-11-02 17:25:01 +00:00
/// <summary>
/// Updates the inherited values.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task UpdateInheritedValues(CancellationToken cancellationToken);
2013-02-21 01:33:05 +00:00
}
}
2013-06-17 20:35:43 +00:00