using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Querying;
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);
///
/// Deletes the item.
///
/// The identifier.
/// The cancellation token.
/// Task.
Task DeleteItem(Guid id, CancellationToken cancellationToken);
///
/// Gets the critic reviews.
///
/// The item id.
/// Task{IEnumerable{ItemReview}}.
IEnumerable GetCriticReviews(Guid itemId);
///
/// Gets the children items.
///
/// The parent identifier.
/// IEnumerable<BaseItem>.
IEnumerable GetChildrenItems(Guid parentId);
///
/// 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 item ids.
///
/// The query.
/// IEnumerable<Guid>.
QueryResult GetItemIds(InternalItemsQuery query);
///
/// Gets the items.
///
/// The query.
/// QueryResult<BaseItem>.
QueryResult GetItems(InternalItemsQuery query);
///
/// Gets the item ids list.
///
/// The query.
/// List<Guid>.
List GetItemIdsList(InternalItemsQuery query);
///
/// Gets the people.
///
/// The query.
/// List<PersonInfo>.
List GetPeople(InternalPeopleQuery query);
///
/// Updates the people.
///
/// The item identifier.
/// The people.
/// Task.
Task UpdatePeople(Guid itemId, List people);
///
/// Gets the people names.
///
/// The query.
/// List<System.String>.
List GetPeopleNames(InternalPeopleQuery query);
///
/// Gets the item ids with path.
///
/// The query.
/// QueryResult<Tuple<Guid, System.String>>.
QueryResult> GetItemIdsWithPath(InternalItemsQuery query);
///
/// Gets the item list.
///
/// The query.
/// List<BaseItem>.
IEnumerable GetItemList(InternalItemsQuery query);
}
}