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;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Persistence
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Provides an interface to implement an Item repository
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IItemRepository : IRepository
|
|
|
|
|
{
|
2013-06-20 09:44:24 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Opens the connection to the repository
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
|
Task Initialize();
|
|
|
|
|
|
2013-02-20 18:33:05 -07: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 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);
|
|
|
|
|
|
2013-05-10 20:43:10 -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);
|
2013-05-10 20:43:10 -07:00
|
|
|
|
|
|
|
|
|
/// <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>
|
|
|
|
|
Task SaveChapters(Guid id, IEnumerable<ChapterInfo> chapters, CancellationToken cancellationToken);
|
2013-06-20 09:44:24 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the children.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="parentId">The parent id.</param>
|
|
|
|
|
/// <returns>IEnumerable{ChildDefinition}.</returns>
|
2013-06-26 09:08:16 -07:00
|
|
|
|
IEnumerable<Guid> GetChildren(Guid parentId);
|
2013-06-20 09:44:24 -07:00
|
|
|
|
|
2014-02-19 21:53:15 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the type of the items of.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="type">The type.</param>
|
|
|
|
|
/// <returns>IEnumerable{Guid}.</returns>
|
|
|
|
|
IEnumerable<BaseItem> GetItemsOfType(Type type);
|
|
|
|
|
|
2013-06-20 09:44:24 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves the children.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="parentId">The parent id.</param>
|
|
|
|
|
/// <param name="children">The children.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-06-26 09:08:16 -07:00
|
|
|
|
Task SaveChildren(Guid parentId, IEnumerable<Guid> children, 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>
|
|
|
|
|
Task SaveMediaStreams(Guid id, IEnumerable<MediaStream> streams, CancellationToken cancellationToken);
|
2013-02-20 18:33:05 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-06-17 13:35:43 -07:00
|
|
|
|
|