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;
|
2016-06-17 13:06:13 +00:00
|
|
|
|
using MediaBrowser.Model.Dto;
|
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
|
|
|
|
|
{
|
|
|
|
|
/// <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
|
|
|
|
|
2013-05-11 03:43:10 +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);
|
2013-05-11 03:43:10 +00: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 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>
|
2016-11-20 05:59:36 +00:00
|
|
|
|
Task SaveItems(List<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>
|
2016-06-11 20:12:01 +00:00
|
|
|
|
Task SaveChapters(Guid id, List<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>
|
2016-06-11 20:12:01 +00:00
|
|
|
|
Task SaveMediaStreams(Guid id, List<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<Guid>.</returns>
|
|
|
|
|
QueryResult<Guid> GetItemIds(InternalItemsQuery query);
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the items.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
|
/// <returns>QueryResult<BaseItem>.</returns>
|
|
|
|
|
QueryResult<BaseItem> GetItems(InternalItemsQuery query);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the item ids list.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="query">The query.</param>
|
|
|
|
|
/// <returns>List<Guid>.</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<PersonInfo>.</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<System.String>.</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<Tuple<Guid, System.String>>.</returns>
|
2016-11-20 09:46:07 +00:00
|
|
|
|
List<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<BaseItem>.</returns>
|
2016-06-20 22:07:18 +00:00
|
|
|
|
List<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);
|
2016-06-17 13:06:13 +00:00
|
|
|
|
|
2016-12-12 19:40:27 +00:00
|
|
|
|
int GetCount(InternalItemsQuery query);
|
|
|
|
|
|
2016-06-17 13:06:13 +00: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-06 04:38:01 +00:00
|
|
|
|
QueryResult<Tuple<BaseItem, ItemCounts>> GetAllArtists(InternalItemsQuery query);
|
2016-08-18 15:13:18 +00:00
|
|
|
|
|
2016-08-19 05:58:35 +00:00
|
|
|
|
List<string> GetGameGenreNames();
|
|
|
|
|
List<string> GetMusicGenreNames();
|
2016-08-18 15:13:18 +00:00
|
|
|
|
List<string> GetStudioNames();
|
2016-08-19 05:58:35 +00:00
|
|
|
|
List<string> GetGenreNames();
|
2016-08-18 15:13:18 +00:00
|
|
|
|
List<string> GetAllArtistNames();
|
2013-02-21 01:33:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2013-06-17 20:35:43 +00:00
|
|
|
|
|