2021-07-24 10:58:50 -07:00
#pragma warning disable CA1002 , CS1591
2020-08-22 21:56:24 +02:00
2019-01-13 20:25:32 +01:00
using System ;
using System.Collections.Generic ;
using System.Threading ;
using System.Threading.Tasks ;
2020-06-30 21:44:41 -04:00
using Jellyfin.Data.Enums ;
2025-03-25 16:45:00 +01:00
using Jellyfin.Database.Implementations.Entities ;
2025-03-25 15:30:22 +00:00
using Jellyfin.Database.Implementations.Enums ;
2019-01-13 20:25:32 +01:00
using MediaBrowser.Controller.Dto ;
2019-01-06 21:50:43 +01:00
using MediaBrowser.Controller.Entities ;
2018-12-27 18:27:57 -05:00
using MediaBrowser.Controller.Entities.Audio ;
using MediaBrowser.Controller.Providers ;
using MediaBrowser.Controller.Resolvers ;
using MediaBrowser.Controller.Sorting ;
using MediaBrowser.Model.Configuration ;
using MediaBrowser.Model.Dto ;
2019-01-13 20:25:32 +01:00
using MediaBrowser.Model.Entities ;
2018-12-27 18:27:57 -05:00
using MediaBrowser.Model.IO ;
2019-01-13 20:25:32 +01:00
using MediaBrowser.Model.Querying ;
2020-05-20 13:07:53 -04:00
using Episode = MediaBrowser . Controller . Entities . TV . Episode ;
using Genre = MediaBrowser . Controller . Entities . Genre ;
using Person = MediaBrowser . Controller . Entities . Person ;
2018-12-27 18:27:57 -05:00
namespace MediaBrowser.Controller.Library
{
/// <summary>
2020-06-16 10:37:52 +12:00
/// Interface ILibraryManager.
2018-12-27 18:27:57 -05:00
/// </summary>
public interface ILibraryManager
{
2021-07-24 10:58:50 -07:00
/// <summary>
/// Occurs when [item added].
/// </summary>
2024-04-17 18:44:50 +02:00
event EventHandler < ItemChangeEventArgs > ? ItemAdded ;
2021-07-24 10:58:50 -07:00
/// <summary>
/// Occurs when [item updated].
/// </summary>
2024-04-17 18:44:50 +02:00
event EventHandler < ItemChangeEventArgs > ? ItemUpdated ;
2021-07-24 10:58:50 -07:00
/// <summary>
/// Occurs when [item removed].
/// </summary>
2024-04-17 18:44:50 +02:00
event EventHandler < ItemChangeEventArgs > ? ItemRemoved ;
2021-07-24 10:58:50 -07:00
/// <summary>
/// Gets the root folder.
/// </summary>
/// <value>The root folder.</value>
AggregateFolder RootFolder { get ; }
bool IsScanRunning { get ; }
2018-12-27 18:27:57 -05:00
/// <summary>
/// Resolves the path.
/// </summary>
/// <param name="fileInfo">The file information.</param>
/// <param name="parent">The parent.</param>
2021-12-20 12:15:20 +01:00
/// <param name="directoryService">An instance of <see cref="IDirectoryService"/>.</param>
2018-12-27 18:27:57 -05:00
/// <returns>BaseItem.</returns>
2024-04-17 18:44:50 +02:00
BaseItem ? ResolvePath (
2020-06-07 20:32:06 -06:00
FileSystemMetadata fileInfo ,
2024-04-17 18:44:50 +02:00
Folder ? parent = null ,
IDirectoryService ? directoryService = null ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
2020-06-16 10:37:52 +12:00
/// Resolves a set of files into a list of BaseItem.
2018-12-27 18:27:57 -05:00
/// </summary>
2021-05-13 07:32:02 -06:00
/// <param name="files">The list of tiles.</param>
/// <param name="directoryService">Instance of the <see cref="IDirectoryService"/> interface.</param>
/// <param name="parent">The parent folder.</param>
/// <param name="libraryOptions">The library options.</param>
/// <param name="collectionType">The collection type.</param>
2021-05-15 15:33:50 -06:00
/// <returns>The items resolved from the paths.</returns>
2020-06-07 20:32:06 -06:00
IEnumerable < BaseItem > ResolvePaths (
IEnumerable < FileSystemMetadata > files ,
2018-12-27 18:27:57 -05:00
IDirectoryService directoryService ,
Folder parent ,
LibraryOptions libraryOptions ,
2023-11-09 14:00:29 -07:00
CollectionType ? collectionType = null ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
2020-06-16 10:37:52 +12:00
/// Gets a Person.
2018-12-27 18:27:57 -05:00
/// </summary>
2021-07-26 16:02:17 -07:00
/// <param name="name">The name of the person.</param>
2018-12-27 18:27:57 -05:00
/// <returns>Task{Person}.</returns>
2024-04-17 18:44:50 +02:00
Person ? GetPerson ( string name ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Finds the by path.
/// </summary>
/// <param name="path">The path.</param>
2020-08-22 21:56:24 +02:00
/// <param name="isFolder"><c>true</c> is the path is a directory; otherwise <c>false</c>.</param>
2018-12-27 18:27:57 -05:00
/// <returns>BaseItem.</returns>
2024-04-17 18:44:50 +02:00
BaseItem ? FindByPath ( string path , bool? isFolder ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the artist.
/// </summary>
2021-07-26 16:19:50 -07:00
/// <param name="name">The name of the artist.</param>
2018-12-27 18:27:57 -05:00
/// <returns>Task{Artist}.</returns>
MusicArtist GetArtist ( string name ) ;
2020-08-21 22:01:19 +02:00
2018-12-27 18:27:57 -05:00
MusicArtist GetArtist ( string name , DtoOptions options ) ;
2020-09-28 15:04:31 -05:00
2018-12-27 18:27:57 -05:00
/// <summary>
2020-06-16 10:37:52 +12:00
/// Gets a Studio.
2018-12-27 18:27:57 -05:00
/// </summary>
2021-07-26 16:31:25 -07:00
/// <param name="name">The name of the studio.</param>
2018-12-27 18:27:57 -05:00
/// <returns>Task{Studio}.</returns>
Studio GetStudio ( string name ) ;
/// <summary>
2020-06-16 10:37:52 +12:00
/// Gets a Genre.
2018-12-27 18:27:57 -05:00
/// </summary>
2021-07-26 17:07:47 -07:00
/// <param name="name">The name of the genre.</param>
2018-12-27 18:27:57 -05:00
/// <returns>Task{Genre}.</returns>
Genre GetGenre ( string name ) ;
/// <summary>
/// Gets the genre.
/// </summary>
2021-07-26 17:58:56 -07:00
/// <param name="name">The name of the music genre.</param>
2018-12-27 18:27:57 -05:00
/// <returns>Task{MusicGenre}.</returns>
MusicGenre GetMusicGenre ( string name ) ;
/// <summary>
2020-06-16 10:37:52 +12:00
/// Gets a Year.
2018-12-27 18:27:57 -05:00
/// </summary>
/// <param name="value">The value.</param>
/// <returns>Task{Year}.</returns>
2021-07-24 10:58:50 -07:00
/// <exception cref="ArgumentOutOfRangeException">Throws if year is invalid.</exception>
2018-12-27 18:27:57 -05:00
Year GetYear ( int value ) ;
/// <summary>
/// Validate and refresh the People sub-set of the IBN.
/// The items are stored in the db but not loaded into memory until actually requested by an operation.
/// </summary>
/// <param name="progress">The progress.</param>
2022-02-15 18:59:46 +01:00
/// <param name="cancellationToken">The cancellation token.</param>
2018-12-27 18:27:57 -05:00
/// <returns>Task.</returns>
2022-02-15 18:59:46 +01:00
Task ValidatePeopleAsync ( IProgress < double > progress , CancellationToken cancellationToken ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
2020-06-16 10:37:52 +12:00
/// Reloads the root media folder.
2018-12-27 18:27:57 -05:00
/// </summary>
/// <param name="progress">The progress.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task ValidateMediaLibrary ( IProgress < double > progress , CancellationToken cancellationToken ) ;
2024-06-06 14:30:34 -04:00
/// <summary>
/// Reloads the root media folder.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="removeRoot">Is remove the library itself allowed.</param>
/// <returns>Task.</returns>
Task ValidateTopLibraryFolders ( CancellationToken cancellationToken , bool removeRoot = false ) ;
2020-08-21 22:01:19 +02:00
Task UpdateImagesAsync ( BaseItem item , bool forceUpdate = false ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the default view.
/// </summary>
/// <returns>IEnumerable{VirtualFolderInfo}.</returns>
List < VirtualFolderInfo > GetVirtualFolders ( ) ;
List < VirtualFolderInfo > GetVirtualFolders ( bool includeRefreshState ) ;
/// <summary>
/// Gets the item by id.
/// </summary>
/// <param name="id">The id.</param>
/// <returns>BaseItem.</returns>
2024-04-17 18:44:50 +02:00
/// <exception cref="ArgumentNullException"><paramref name="id"/> is <c>null</c>.</exception>
BaseItem ? GetItemById ( Guid id ) ;
2018-12-27 18:27:57 -05:00
2024-02-26 05:09:40 -07:00
/// <summary>
/// Gets the item by id, as T.
/// </summary>
/// <param name="id">The item id.</param>
/// <typeparam name="T">The type of item.</typeparam>
/// <returns>The item.</returns>
2024-04-17 18:44:50 +02:00
T ? GetItemById < T > ( Guid id )
2024-02-26 05:09:40 -07:00
where T : BaseItem ;
2024-04-14 08:18:36 -06:00
/// <summary>
/// Gets the item by id, as T, and validates user access.
/// </summary>
/// <param name="id">The item id.</param>
/// <param name="userId">The user id to validate against.</param>
/// <typeparam name="T">The type of item.</typeparam>
/// <returns>The item if found.</returns>
2024-04-17 18:44:50 +02:00
public T ? GetItemById < T > ( Guid id , Guid userId )
2024-04-14 08:18:36 -06:00
where T : BaseItem ;
/// <summary>
/// Gets the item by id, as T, and validates user access.
/// </summary>
/// <param name="id">The item id.</param>
/// <param name="user">The user to validate against.</param>
/// <typeparam name="T">The type of item.</typeparam>
/// <returns>The item if found.</returns>
2024-04-17 18:44:50 +02:00
public T ? GetItemById < T > ( Guid id , User ? user )
2024-04-14 08:18:36 -06:00
where T : BaseItem ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the intros.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="user">The user.</param>
/// <returns>IEnumerable{System.String}.</returns>
2020-05-20 13:07:53 -04:00
Task < IEnumerable < Video > > GetIntros ( BaseItem item , User user ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Adds the parts.
/// </summary>
/// <param name="rules">The rules.</param>
/// <param name="resolvers">The resolvers.</param>
/// <param name="introProviders">The intro providers.</param>
/// <param name="itemComparers">The item comparers.</param>
2025-05-05 05:21:44 +02:00
/// <param name="postScanTasks">The post scan tasks.</param>
2020-02-19 21:56:35 +01:00
void AddParts (
IEnumerable < IResolverIgnoreRule > rules ,
2018-12-27 18:27:57 -05:00
IEnumerable < IItemResolver > resolvers ,
IEnumerable < IIntroProvider > introProviders ,
IEnumerable < IBaseItemComparer > itemComparers ,
2025-05-05 05:21:44 +02:00
IEnumerable < ILibraryPostScanTask > postScanTasks ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Sorts the specified items.
/// </summary>
/// <param name="items">The items.</param>
/// <param name="user">The user.</param>
/// <param name="sortBy">The sort by.</param>
/// <param name="sortOrder">The sort order.</param>
/// <returns>IEnumerable{BaseItem}.</returns>
2024-04-17 18:44:50 +02:00
IEnumerable < BaseItem > Sort ( IEnumerable < BaseItem > items , User ? user , IEnumerable < ItemSortBy > sortBy , SortOrder sortOrder ) ;
2020-08-21 22:01:19 +02:00
2024-04-17 18:44:50 +02:00
IEnumerable < BaseItem > Sort ( IEnumerable < BaseItem > items , User ? user , IEnumerable < ( ItemSortBy OrderBy , SortOrder SortOrder ) > orderBy ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the user root folder.
/// </summary>
/// <returns>UserRootFolder.</returns>
Folder GetUserRootFolder ( ) ;
/// <summary>
/// Creates the item.
/// </summary>
2021-07-24 10:58:50 -07:00
/// <param name="item">Item to create.</param>
/// <param name="parent">Parent of new item.</param>
2024-04-17 18:44:50 +02:00
void CreateItem ( BaseItem item , BaseItem ? parent ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Creates the items.
/// </summary>
2021-07-24 10:58:50 -07:00
/// <param name="items">Items to create.</param>
/// <param name="parent">Parent of new items.</param>
/// <param name="cancellationToken">CancellationToken to use for operation.</param>
2025-02-09 18:30:53 +01:00
void CreateItems ( IReadOnlyList < BaseItem > items , BaseItem ? parent , CancellationToken cancellationToken ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Updates the item.
/// </summary>
2021-07-24 10:58:50 -07:00
/// <param name="items">Items to update.</param>
/// <param name="parent">Parent of updated items.</param>
/// <param name="updateReason">Reason for update.</param>
/// <param name="cancellationToken">CancellationToken to use for operation.</param>
/// <returns>Returns a Task that can be awaited.</returns>
2020-08-21 22:01:19 +02:00
Task UpdateItemsAsync ( IReadOnlyList < BaseItem > items , BaseItem parent , ItemUpdateType updateReason , CancellationToken cancellationToken ) ;
2020-05-19 14:50:14 +03:00
2020-08-21 22:01:19 +02:00
/// <summary>
/// Updates the item.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="parent">The parent item.</param>
/// <param name="updateReason">The update reason.</param>
/// <param name="cancellationToken">The cancellation token.</param>
2021-07-24 10:58:50 -07:00
/// <returns>Returns a Task that can be awaited.</returns>
2020-08-21 22:01:19 +02:00
Task UpdateItemAsync ( BaseItem item , BaseItem parent , ItemUpdateType updateReason , CancellationToken cancellationToken ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Retrieves the item.
/// </summary>
/// <param name="id">The id.</param>
/// <returns>BaseItem.</returns>
BaseItem RetrieveItem ( Guid id ) ;
/// <summary>
/// Finds the type of the collection.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>System.String.</returns>
2023-11-09 14:00:29 -07:00
CollectionType ? GetContentType ( BaseItem item ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the type of the inherited content.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>System.String.</returns>
2023-11-09 14:00:29 -07:00
CollectionType ? GetInheritedContentType ( BaseItem item ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the type of the configured content.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>System.String.</returns>
2023-11-09 14:00:29 -07:00
CollectionType ? GetConfiguredContentType ( BaseItem item ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the type of the configured content.
/// </summary>
/// <param name="path">The path.</param>
/// <returns>System.String.</returns>
2023-11-09 14:00:29 -07:00
CollectionType ? GetConfiguredContentType ( string path ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Normalizes the root path list.
/// </summary>
/// <param name="paths">The paths.</param>
/// <returns>IEnumerable{System.String}.</returns>
List < FileSystemMetadata > NormalizeRootPathList ( IEnumerable < FileSystemMetadata > paths ) ;
/// <summary>
/// Registers the item.
/// </summary>
/// <param name="item">The item.</param>
void RegisterItem ( BaseItem item ) ;
/// <summary>
/// Deletes the item.
/// </summary>
2021-07-24 10:58:50 -07:00
/// <param name="item">Item to delete.</param>
/// <param name="options">Options to use for deletion.</param>
2018-12-27 18:27:57 -05:00
void DeleteItem ( BaseItem item , DeleteOptions options ) ;
2025-09-25 00:20:30 +03:00
/// <summary>
/// Deletes items that are not having any children like Actors.
/// </summary>
/// <param name="items">Items to delete.</param>
/// <remarks>In comparison to <see cref="DeleteItem(BaseItem, DeleteOptions, BaseItem, bool)"/> this method skips a lot of steps assuming there are no children to recusively delete nor does it define the special handling for channels and alike.</remarks>
public void DeleteItemsUnsafeFast ( IEnumerable < BaseItem > items ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Deletes the item.
/// </summary>
2021-07-24 10:58:50 -07:00
/// <param name="item">Item to delete.</param>
/// <param name="options">Options to use for deletion.</param>
/// <param name="notifyParentItem">Notify parent of deletion.</param>
2018-12-27 18:27:57 -05:00
void DeleteItem ( BaseItem item , DeleteOptions options , bool notifyParentItem ) ;
/// <summary>
/// Deletes the item.
/// </summary>
2021-07-24 10:58:50 -07:00
/// <param name="item">Item to delete.</param>
/// <param name="options">Options to use for deletion.</param>
/// <param name="parent">Parent of item.</param>
/// <param name="notifyParentItem">Notify parent of deletion.</param>
2018-12-27 18:27:57 -05:00
void DeleteItem ( BaseItem item , DeleteOptions options , BaseItem parent , bool notifyParentItem ) ;
/// <summary>
/// Gets the named view.
/// </summary>
/// <param name="user">The user.</param>
/// <param name="name">The name.</param>
/// <param name="parentId">The parent identifier.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
2021-07-24 10:58:50 -07:00
/// <returns>The named view.</returns>
2020-05-12 22:10:35 -04:00
UserView GetNamedView (
2020-05-20 13:07:53 -04:00
User user ,
2018-12-27 18:27:57 -05:00
string name ,
Guid parentId ,
2023-11-09 14:00:29 -07:00
CollectionType ? viewType ,
2019-01-06 21:50:43 +01:00
string sortName ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the named view.
/// </summary>
/// <param name="user">The user.</param>
/// <param name="name">The name.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
2021-07-24 10:58:50 -07:00
/// <returns>The named view.</returns>
2020-05-12 22:10:35 -04:00
UserView GetNamedView (
2020-05-20 13:07:53 -04:00
User user ,
2018-12-27 18:27:57 -05:00
string name ,
2023-11-09 14:00:29 -07:00
CollectionType ? viewType ,
2018-12-27 18:27:57 -05:00
string sortName ) ;
/// <summary>
/// Gets the named view.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
2021-07-24 10:58:50 -07:00
/// <returns>The named view.</returns>
2020-08-21 22:01:19 +02:00
UserView GetNamedView (
string name ,
2023-11-09 14:00:29 -07:00
CollectionType viewType ,
2018-12-27 18:27:57 -05:00
string sortName ) ;
/// <summary>
/// Gets the named view.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="parentId">The parent identifier.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
/// <param name="uniqueId">The unique identifier.</param>
2021-06-06 09:16:41 -06:00
/// <returns>The named view.</returns>
2020-08-21 22:01:19 +02:00
UserView GetNamedView (
string name ,
2018-12-27 18:27:57 -05:00
Guid parentId ,
2023-11-09 14:00:29 -07:00
CollectionType ? viewType ,
2018-12-27 18:27:57 -05:00
string sortName ,
string uniqueId ) ;
/// <summary>
/// Gets the shadow view.
/// </summary>
/// <param name="parent">The parent.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="sortName">Name of the sort.</param>
2021-06-06 09:16:41 -06:00
/// <returns>The shadow view.</returns>
2020-08-21 22:01:19 +02:00
UserView GetShadowView (
BaseItem parent ,
2023-11-09 14:00:29 -07:00
CollectionType ? viewType ,
2021-06-06 09:16:41 -06:00
string sortName ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the season number from path.
/// </summary>
/// <param name="path">The path.</param>
2025-03-23 17:05:40 +01:00
/// <param name="parentId">The parent id.</param>
2018-12-27 18:27:57 -05:00
/// <returns>System.Nullable<System.Int32>.</returns>
2025-03-23 17:05:40 +01:00
int? GetSeasonNumberFromPath ( string path , Guid ? parentId ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Fills the missing episode numbers from path.
/// </summary>
2021-07-24 10:58:50 -07:00
/// <param name="episode">Episode to use.</param>
/// <param name="forceRefresh">Option to force refresh of episode numbers.</param>
/// <returns>True if successful.</returns>
2018-12-27 18:27:57 -05:00
bool FillMissingEpisodeNumbersFromPath ( Episode episode , bool forceRefresh ) ;
/// <summary>
/// Parses the name.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>ItemInfo.</returns>
ItemLookupInfo ParseName ( string name ) ;
/// <summary>
/// Gets the new item identifier.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="type">The type.</param>
/// <returns>Guid.</returns>
Guid GetNewItemId ( string key , Type type ) ;
/// <summary>
/// Finds the extras.
/// </summary>
/// <param name="owner">The owner.</param>
/// <param name="fileSystemChildren">The file system children.</param>
2021-12-20 12:15:20 +01:00
/// <param name="directoryService">An instance of <see cref="IDirectoryService"/>.</param>
/// <returns>IEnumerable<BaseItem>.</returns>
2022-01-28 12:21:40 +01:00
IEnumerable < BaseItem > FindExtras ( BaseItem owner , IReadOnlyList < FileSystemMetadata > fileSystemChildren , IDirectoryService directoryService ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the collection folders.
/// </summary>
/// <param name="item">The item.</param>
2022-05-17 22:58:49 +02:00
/// <returns>The folders that contain the item.</returns>
2018-12-27 18:27:57 -05:00
List < Folder > GetCollectionFolders ( BaseItem item ) ;
2022-05-17 22:58:49 +02:00
/// <summary>
/// Gets the collection folders.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="allUserRootChildren">The root folders to consider.</param>
/// <returns>The folders that contain the item.</returns>
List < Folder > GetCollectionFolders ( BaseItem item , IEnumerable < Folder > allUserRootChildren ) ;
2018-12-27 18:27:57 -05:00
LibraryOptions GetLibraryOptions ( BaseItem item ) ;
/// <summary>
/// Gets the people.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>List<PersonInfo>.</returns>
2024-10-09 10:36:08 +00:00
IReadOnlyList < PersonInfo > GetPeople ( BaseItem item ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the people.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>List<PersonInfo>.</returns>
2024-10-09 10:36:08 +00:00
IReadOnlyList < PersonInfo > GetPeople ( InternalPeopleQuery query ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the people items.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>List<Person>.</returns>
2024-10-09 10:36:08 +00:00
IReadOnlyList < Person > GetPeopleItems ( InternalPeopleQuery query ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Updates the people.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="people">The people.</param>
void UpdatePeople ( BaseItem item , List < PersonInfo > people ) ;
2021-04-24 20:22:23 +02:00
/// <summary>
/// Asynchronously updates the people.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="people">The people.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>The async task.</returns>
2024-10-09 10:36:08 +00:00
Task UpdatePeopleAsync ( BaseItem item , IReadOnlyList < PersonInfo > people , CancellationToken cancellationToken ) ;
2021-04-24 20:22:23 +02:00
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the item ids.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>List<Guid>.</returns>
2024-10-09 10:36:08 +00:00
IReadOnlyList < Guid > GetItemIds ( InternalItemsQuery query ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the people names.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>List<System.String>.</returns>
2024-10-09 10:36:08 +00:00
IReadOnlyList < string > GetPeopleNames ( InternalPeopleQuery query ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Queries the items.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult<BaseItem>.</returns>
QueryResult < BaseItem > QueryItems ( InternalItemsQuery query ) ;
2024-04-17 18:44:50 +02:00
string GetPathAfterNetworkSubstitution ( string path , BaseItem ? ownerItem = null ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Converts the image to local.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="image">The image.</param>
/// <param name="imageIndex">Index of the image.</param>
2024-03-03 13:32:55 -07:00
/// <param name="removeOnFailure">Whether to remove the image from the item on failure.</param>
2018-12-27 18:27:57 -05:00
/// <returns>Task.</returns>
2024-03-03 13:32:55 -07:00
Task < ItemImageInfo > ConvertImageToLocal ( BaseItem item , ItemImageInfo image , int imageIndex , bool removeOnFailure = true ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the items.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult<BaseItem>.</returns>
2024-10-09 10:36:08 +00:00
IReadOnlyList < BaseItem > GetItemList ( InternalItemsQuery query ) ;
2018-12-27 18:27:57 -05:00
2024-10-09 10:36:08 +00:00
IReadOnlyList < BaseItem > GetItemList ( InternalItemsQuery query , bool allowExternalContent ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the items.
/// </summary>
2021-07-24 10:58:50 -07:00
/// <param name="query">The query to use.</param>
/// <param name="parents">Items to use for query.</param>
/// <returns>List of items.</returns>
2024-10-09 10:36:08 +00:00
IReadOnlyList < BaseItem > GetItemList ( InternalItemsQuery query , List < BaseItem > parents ) ;
2018-12-27 18:27:57 -05:00
2025-03-27 10:26:47 +08:00
/// <summary>
/// Gets the TVShow/Album items for Latest api.
/// </summary>
/// <param name="query">The query to use.</param>
/// <param name="parents">Items to use for query.</param>
/// <param name="collectionType">Collection Type.</param>
/// <returns>List of items.</returns>
IReadOnlyList < BaseItem > GetLatestItemList ( InternalItemsQuery query , IReadOnlyList < BaseItem > parents , CollectionType collectionType ) ;
2025-03-18 17:37:04 -06:00
/// <summary>
/// Gets the list of series presentation keys for next up.
/// </summary>
/// <param name="query">The query to use.</param>
/// <param name="parents">Items to use for query.</param>
/// <param name="dateCutoff">The minimum date for a series to have been most recently watched.</param>
/// <returns>List of series presentation keys.</returns>
IReadOnlyList < string > GetNextUpSeriesKeys ( InternalItemsQuery query , IReadOnlyCollection < BaseItem > parents , DateTime dateCutoff ) ;
2018-12-27 18:27:57 -05:00
/// <summary>
/// Gets the items result.
/// </summary>
/// <param name="query">The query.</param>
/// <returns>QueryResult<BaseItem>.</returns>
QueryResult < BaseItem > GetItemsResult ( InternalItemsQuery query ) ;
/// <summary>
2025-05-05 05:21:44 +02:00
/// Checks if the file is ignored.
2018-12-27 18:27:57 -05:00
/// </summary>
/// <param name="file">The file.</param>
/// <param name="parent">The parent.</param>
2025-05-05 05:21:44 +02:00
/// <returns><c>true</c> if ignored, <c>false</c> otherwise.</returns>
2018-12-27 18:27:57 -05:00
bool IgnoreFile ( FileSystemMetadata file , BaseItem parent ) ;
Guid GetStudioId ( string name ) ;
Guid GetGenreId ( string name ) ;
Guid GetMusicGenreId ( string name ) ;
2021-02-24 02:05:12 +01:00
Task AddVirtualFolder ( string name , CollectionTypeOptions ? collectionType , LibraryOptions options , bool refreshLibrary ) ;
2020-08-21 22:01:19 +02:00
2018-12-27 18:27:57 -05:00
Task RemoveVirtualFolder ( string name , bool refreshLibrary ) ;
2020-08-21 22:01:19 +02:00
2021-09-03 18:46:34 +02:00
void AddMediaPath ( string virtualFolderName , MediaPathInfo mediaPath ) ;
2020-08-21 22:01:19 +02:00
2021-09-03 18:46:34 +02:00
void UpdateMediaPath ( string virtualFolderName , MediaPathInfo mediaPath ) ;
2020-08-21 22:01:19 +02:00
2021-09-03 18:46:34 +02:00
void RemoveMediaPath ( string virtualFolderName , string mediaPath ) ;
2018-12-27 18:27:57 -05:00
2021-12-24 14:18:24 -07:00
QueryResult < ( BaseItem Item , ItemCounts ItemCounts ) > GetGenres ( InternalItemsQuery query ) ;
2020-08-21 22:01:19 +02:00
2021-12-24 14:18:24 -07:00
QueryResult < ( BaseItem Item , ItemCounts ItemCounts ) > GetMusicGenres ( InternalItemsQuery query ) ;
2020-08-21 22:01:19 +02:00
2021-12-24 14:18:24 -07:00
QueryResult < ( BaseItem Item , ItemCounts ItemCounts ) > GetStudios ( InternalItemsQuery query ) ;
2020-08-21 22:01:19 +02:00
2021-12-24 14:18:24 -07:00
QueryResult < ( BaseItem Item , ItemCounts ItemCounts ) > GetArtists ( InternalItemsQuery query ) ;
2020-08-21 22:01:19 +02:00
2025-09-25 00:20:30 +03:00
IReadOnlyDictionary < string , MusicArtist [ ] > GetArtists ( IReadOnlyList < string > names ) ;
2021-12-24 14:18:24 -07:00
QueryResult < ( BaseItem Item , ItemCounts ItemCounts ) > GetAlbumArtists ( InternalItemsQuery query ) ;
2020-08-21 22:01:19 +02:00
2021-12-24 14:18:24 -07:00
QueryResult < ( BaseItem Item , ItemCounts ItemCounts ) > GetAllArtists ( InternalItemsQuery query ) ;
2018-12-27 18:27:57 -05:00
int GetCount ( InternalItemsQuery query ) ;
2025-08-11 21:03:55 -06:00
ItemCounts GetItemCounts ( InternalItemsQuery query ) ;
2020-12-10 14:47:47 +01:00
Task RunMetadataSavers ( BaseItem item , ItemUpdateType updateReason ) ;
2020-11-21 17:20:31 -05:00
2020-12-01 11:07:41 -07:00
BaseItem GetParentItem ( Guid ? parentId , Guid ? userId ) ;
2022-08-01 14:25:44 -04:00
/// <summary>
/// Queue a library scan.
/// </summary>
/// <remarks>
/// This exists so plugins can trigger a library scan.
/// </remarks>
void QueueLibraryScan ( ) ;
2018-12-27 18:27:57 -05:00
}
2019-01-06 21:50:43 +01:00
}