using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Persistence
{
///
/// Provides an interface to implement an Item repository
///
public interface IItemRepository : IRepository
{
///
/// Opens the connection to the repository
///
/// Task.
Task Initialize();
///
/// Saves an item
///
/// The item.
/// The cancellation token.
/// Task.
Task SaveItem(BaseItem item, CancellationToken cancellationToken);
///
/// Gets the critic reviews.
///
/// The item id.
/// Task{IEnumerable{ItemReview}}.
IEnumerable GetCriticReviews(Guid itemId);
///
/// Saves the critic reviews.
///
/// The item id.
/// The critic reviews.
/// Task.
Task SaveCriticReviews(Guid itemId, IEnumerable criticReviews);
///
/// Saves the items.
///
/// The items.
/// The cancellation token.
/// Task.
Task SaveItems(IEnumerable items, CancellationToken cancellationToken);
///
/// Retrieves the item.
///
/// The id.
/// BaseItem.
BaseItem RetrieveItem(Guid id);
///
/// Gets chapters for an item
///
///
///
IEnumerable GetChapters(Guid id);
///
/// Gets a single chapter for an item
///
///
///
///
ChapterInfo GetChapter(Guid id, int index);
///
/// Saves the chapters.
///
/// The id.
/// The chapters.
/// The cancellation token.
/// Task.
Task SaveChapters(Guid id, IEnumerable chapters, CancellationToken cancellationToken);
///
/// Gets the children.
///
/// The parent id.
/// IEnumerable{ChildDefinition}.
IEnumerable GetChildren(Guid parentId);
///
/// Saves the children.
///
/// The parent id.
/// The children.
/// The cancellation token.
/// Task.
Task SaveChildren(Guid parentId, IEnumerable children, CancellationToken cancellationToken);
///
/// Gets the media streams.
///
/// The query.
/// IEnumerable{MediaStream}.
IEnumerable GetMediaStreams(MediaStreamQuery query);
///
/// Saves the media streams.
///
/// The identifier.
/// The streams.
/// The cancellation token.
/// Task.
Task SaveMediaStreams(Guid id, IEnumerable streams, CancellationToken cancellationToken);
///
/// Gets the provider history.
///
/// The item identifier.
/// IEnumerable{BaseProviderInfo}.
IEnumerable GetProviderHistory(Guid itemId);
///
/// Saves the provider history.
///
/// The identifier.
/// The history.
/// The cancellation token.
/// Task.
Task SaveProviderHistory(Guid id, IEnumerable history, CancellationToken cancellationToken);
}
}