#pragma warning disable CA1002, CS1591
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Data.Enums;
using Jellyfin.Database.Implementations.Entities;
using Jellyfin.Database.Implementations.Enums;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
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;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Querying;
using Episode = MediaBrowser.Controller.Entities.TV.Episode;
using Genre = MediaBrowser.Controller.Entities.Genre;
using LinkedChildType = MediaBrowser.Controller.Entities.LinkedChildType;
using Person = MediaBrowser.Controller.Entities.Person;
namespace MediaBrowser.Controller.Library
{
///
/// Interface ILibraryManager.
///
public interface ILibraryManager
{
///
/// Occurs when [item added].
///
event EventHandler? ItemAdded;
///
/// Occurs when [item updated].
///
event EventHandler? ItemUpdated;
///
/// Occurs when [item removed].
///
event EventHandler? ItemRemoved;
///
/// Gets the root folder.
///
/// The root folder.
AggregateFolder RootFolder { get; }
bool IsScanRunning { get; }
///
/// Resolves the path.
///
/// The file information.
/// The parent.
/// An instance of .
/// BaseItem.
BaseItem? ResolvePath(
FileSystemMetadata fileInfo,
Folder? parent = null,
IDirectoryService? directoryService = null);
///
/// Resolves a set of files into a list of BaseItem.
///
/// The list of tiles.
/// Instance of the interface.
/// The parent folder.
/// The library options.
/// The collection type.
/// The items resolved from the paths.
IEnumerable ResolvePaths(
IEnumerable files,
IDirectoryService directoryService,
Folder parent,
LibraryOptions libraryOptions,
CollectionType? collectionType = null);
///
/// Gets a Person.
///
/// The name of the person.
/// Task{Person}.
Person? GetPerson(string name);
///
/// Finds the by path.
///
/// The path.
/// true is the path is a directory; otherwise false.
/// BaseItem.
BaseItem? FindByPath(string path, bool? isFolder);
///
/// Gets the artist.
///
/// The name of the artist.
/// Task{Artist}.
MusicArtist GetArtist(string name);
MusicArtist GetArtist(string name, DtoOptions options);
///
/// Gets a Studio.
///
/// The name of the studio.
/// Task{Studio}.
Studio GetStudio(string name);
///
/// Gets a Genre.
///
/// The name of the genre.
/// Task{Genre}.
Genre GetGenre(string name);
///
/// Gets the genre.
///
/// The name of the music genre.
/// Task{MusicGenre}.
MusicGenre GetMusicGenre(string name);
///
/// Gets a Year.
///
/// The value.
/// Task{Year}.
/// Throws if year is invalid.
Year GetYear(int value);
///
/// 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.
///
/// The progress.
/// The cancellation token.
/// Task.
Task ValidatePeopleAsync(IProgress progress, CancellationToken cancellationToken);
///
/// Reloads the root media folder.
///
/// The progress.
/// The cancellation token.
/// Task.
Task ValidateMediaLibrary(IProgress progress, CancellationToken cancellationToken);
///
/// Reloads the root media folder.
///
/// The cancellation token.
/// Is remove the library itself allowed.
/// Task.
Task ValidateTopLibraryFolders(CancellationToken cancellationToken, bool removeRoot = false);
Task UpdateImagesAsync(BaseItem item, bool forceUpdate = false);
///
/// Gets the default view.
///
/// IEnumerable{VirtualFolderInfo}.
List GetVirtualFolders();
List GetVirtualFolders(bool includeRefreshState);
///
/// Gets the item by id.
///
/// The id.
/// BaseItem.
/// is null.
BaseItem? GetItemById(Guid id);
///
/// Gets the item by id, as T.
///
/// The item id.
/// The type of item.
/// The item.
T? GetItemById(Guid id)
where T : BaseItem;
///
/// Gets the item by id, as T, and validates user access.
///
/// The item id.
/// The user id to validate against.
/// The type of item.
/// The item if found.
public T? GetItemById(Guid id, Guid userId)
where T : BaseItem;
///
/// Gets the item by id, as T, and validates user access.
///
/// The item id.
/// The user to validate against.
/// The type of item.
/// The item if found.
public T? GetItemById(Guid id, User? user)
where T : BaseItem;
///
/// Gets the intros.
///
/// The item.
/// The user.
/// IEnumerable{System.String}.
Task> GetIntros(BaseItem item, User user);
///
/// Gets the IDs of local alternate versions for a video.
/// Local alternate versions are alternate quality versions at different file paths.
///
/// The video item.
/// Enumerable of alternate version item IDs.
IEnumerable GetLocalAlternateVersionIds(Video video);
///
/// Gets the linked alternate versions for a video.
/// Linked alternate versions are different items representing the same content (e.g., Director's Cut).
///
/// The video item.
/// Enumerable of linked Video items.
IEnumerable