Class BaseApiService
Inheritance
System.Object
BaseApiService
Assembly: MediaBrowser.Controller.dll
public class BaseApiService : IService, IRequiresRequest
Constructors
Initializes a new instance of the System.Object class.
Declaration
Properties
Declaration
public IServerApplicationHost ApplicationHost { get; set; }
Property Value
AuthorizationContext
Declaration
public IAuthorizationContext AuthorizationContext { get; set; }
Property Value
Declaration
public IServerConfigurationManager ConfigurationManager { get; set; }
Property Value
Declaration
public ILibraryManager LibraryManager { get; set; }
Property Value
Declaration
public ILocalizationManager LocalizationManager { get; set; }
Property Value
Declaration
public ILogger Logger { get; set; }
Property Value
| Type |
Description |
| ILogger |
The logger.
|
Gets or sets the request context.
Declaration
public IRequest Request { get; set; }
Property Value
| Type |
Description |
| IRequest |
The request context.
|
Gets or sets the HTTP result factory.
Declaration
public IHttpResultFactory ResultFactory { get; set; }
Property Value
Declaration
public IUserManager UserManager { get; set; }
Property Value
Methods
Declaration
public static void AddRecordingKeywordsToQuery(InternalItemsQuery query, KeywordInfo[] keywords)
Parameters
Declaration
protected void AssertAPIAvailable(User user)
Parameters
| Type |
Name |
Description |
| User |
user |
|
Declaration
protected void AssertCanEditItem(User user, BaseItem item, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| User |
user |
|
| BaseItem |
item |
|
| System.Threading.CancellationToken |
cancellationToken |
|
Declaration
protected void AssertCanManageUser(long userId)
Parameters
| Type |
Name |
Description |
| System.Int64 |
userId |
|
Declaration
protected void AssertCanManageUser(long userId, bool restrictUserPreferences)
Parameters
| Type |
Name |
Description |
| System.Int64 |
userId |
|
| System.Boolean |
restrictUserPreferences |
|
Declaration
protected void AssertCanManageUser(string userId)
Parameters
| Type |
Name |
Description |
| System.String |
userId |
|
Declaration
protected MusicArtist GetArtist(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
GetArtist(String, IDataContext)
Declaration
protected MusicArtist GetArtist(string name, IDataContext dataContext)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| IDataContext |
dataContext |
|
Returns
Declaration
protected Exception GetDirectoryNotFoundException(string path)
Parameters
| Type |
Name |
Description |
| System.String |
path |
|
Returns
| Type |
Description |
| System.Exception |
|
GetDtoOptions(IAuthorizationContext, Object)
Declaration
protected DtoOptions GetDtoOptions(IAuthorizationContext authContext, object request)
Parameters
Returns
Declaration
protected FileNotFoundException GetFileNotFoundException(string path)
Parameters
| Type |
Name |
Description |
| System.String |
path |
|
Returns
| Type |
Description |
| System.IO.FileNotFoundException |
|
Declaration
protected GameGenre GetGameGenre(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
GetGameGenre(String, IDataContext)
Declaration
protected GameGenre GetGameGenre(string name, IDataContext dataContext)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| IDataContext |
dataContext |
|
Returns
Declaration
protected Genre GetGenre(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
GetGenre(String, IDataContext)
Declaration
protected Genre GetGenre(string name, IDataContext dataContext)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| IDataContext |
dataContext |
|
Returns
Declaration
public string GetHeader(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
| Type |
Description |
| System.String |
|
Declaration
protected BaseItem GetItemByName(string name, string type)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| System.String |
type |
|
Returns
GetItemByName(String, String, IDataContext)
Declaration
protected BaseItem GetItemByName(string name, string type, IDataContext dataContext)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| System.String |
type |
|
| IDataContext |
dataContext |
|
Returns
Declaration
protected InternalItemsQuery GetItemsQuery(BaseItem parentItem, BaseItemsRequest request, DtoOptions dtoOptions, User user, ILibraryManager libraryManager, ILocalizationManager localization)
Parameters
Returns
GetItemsQuery(BaseItem, BaseItemsRequest, DtoOptions, User, IDataContext)
Declaration
protected InternalItemsQuery GetItemsQuery(BaseItem parentItem, BaseItemsRequest request, DtoOptions dtoOptions, User user, IDataContext dataContext)
Parameters
Returns
Declaration
protected MusicGenre GetMusicGenre(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
GetMusicGenre(String, IDataContext)
Declaration
protected MusicGenre GetMusicGenre(string name, IDataContext dataContext)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| IDataContext |
dataContext |
|
Returns
Declaration
protected string GetPathValue(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Returns
| Type |
Description |
| System.String |
|
Declaration
protected Person GetPerson(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
GetPerson(String, IDataContext)
Declaration
protected Person GetPerson(string name, IDataContext dataContext)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| IDataContext |
dataContext |
|
Returns
Declaration
protected BaseItem GetQueryParent(string parentId, User user)
Parameters
| Type |
Name |
Description |
| System.String |
parentId |
|
| User |
user |
|
Returns
GetQueryParent(String, User, IDataContext)
Declaration
protected BaseItem GetQueryParent(string parentId, User user, IDataContext dataContext)
Parameters
Returns
GetQueryParentFolder(String, User, IDataContext, Boolean)
Declaration
protected Folder GetQueryParentFolder(string parentId, User user, IDataContext dataContext, bool throwIfNotFound)
Parameters
| Type |
Name |
Description |
| System.String |
parentId |
|
| User |
user |
|
| IDataContext |
dataContext |
|
| System.Boolean |
throwIfNotFound |
|
Returns
Declaration
protected Folder GetQueryParentFolder(string parentId, User user, bool throwIfNotFound)
Parameters
| Type |
Name |
Description |
| System.String |
parentId |
|
| User |
user |
|
| System.Boolean |
throwIfNotFound |
|
Returns
GetSession(ISessionContext)
Declaration
protected SessionInfo GetSession(ISessionContext sessionContext)
Parameters
Returns
Declaration
protected Studio GetStudio(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
GetStudio(String, IDataContext)
Declaration
protected Studio GetStudio(string name, IDataContext dataContext)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| IDataContext |
dataContext |
|
Returns
Declaration
protected User GetUserForRequest(AuthorizationInfo auth, string requestedUserId, bool autoRevertToLoggedInUser = true)
Parameters
| Type |
Name |
Description |
| AuthorizationInfo |
auth |
|
| System.String |
requestedUserId |
|
| System.Boolean |
autoRevertToLoggedInUser |
|
Returns
Declaration
protected User GetUserForRequest(Guid requestedUserId, bool autoRevertToLoggedInUser = true)
Parameters
| Type |
Name |
Description |
| System.Guid |
requestedUserId |
|
| System.Boolean |
autoRevertToLoggedInUser |
|
Returns
Declaration
protected User GetUserForRequest(string requestedUserId, bool autoRevertToLoggedInUser = true)
Parameters
| Type |
Name |
Description |
| System.String |
requestedUserId |
|
| System.Boolean |
autoRevertToLoggedInUser |
|
Returns
Declaration
protected Guid GetUserGuidForRequest(AuthorizationInfo auth, ReadOnlySpan<char> requestedUserId, bool autoRevertToLoggedInUser = true)
Parameters
| Type |
Name |
Description |
| AuthorizationInfo |
auth |
|
| System.ReadOnlySpan<System.Char> |
requestedUserId |
|
| System.Boolean |
autoRevertToLoggedInUser |
|
Returns
| Type |
Description |
| System.Guid |
|
Declaration
protected long GetUserIdForRequest(AuthorizationInfo auth, string requestedUserId, bool autoRevertToLoggedInUser = true)
Parameters
| Type |
Name |
Description |
| AuthorizationInfo |
auth |
|
| System.String |
requestedUserId |
|
| System.Boolean |
autoRevertToLoggedInUser |
|
Returns
| Type |
Description |
| System.Int64 |
|
Declaration
protected long GetUserIdForRequest(string requestedUserId)
Parameters
| Type |
Name |
Description |
| System.String |
requestedUserId |
|
Returns
| Type |
Description |
| System.Int64 |
|
Declaration
protected string[] ParseIds(string value)
Parameters
| Type |
Name |
Description |
| System.String |
value |
|
Returns
| Type |
Description |
| System.String[] |
|
Declaration
protected long[] ParseLibraryIds(string value)
Parameters
| Type |
Name |
Description |
| System.String |
value |
|
Returns
| Type |
Description |
| System.Int64[] |
|
ParseLibraryIds(String, IDataContext)
Declaration
protected long[] ParseLibraryIds(string value, IDataContext dataContext)
Parameters
| Type |
Name |
Description |
| System.String |
value |
|
| IDataContext |
dataContext |
|
Returns
| Type |
Description |
| System.Int64[] |
|
Declaration
protected long[] ParseUserIds(string value)
Parameters
| Type |
Name |
Description |
| System.String |
value |
|
Returns
| Type |
Description |
| System.Int64[] |
|
SetContentDisposition(IDictionary<String, String>, String)
Declaration
public static void SetContentDisposition(IDictionary<string, string> headers, string name)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IDictionary<System.String, System.String> |
headers |
|
| System.String |
name |
|
Declaration
public static string[] SplitValue(string value, char delim)
Parameters
| Type |
Name |
Description |
| System.String |
value |
|
| System.Char |
delim |
|
Returns
| Type |
Description |
| System.String[] |
|
Declaration
protected object ToOptimizedResult<T>(T result)
where T : class
Parameters
| Type |
Name |
Description |
| T |
result |
The result.
|
Returns
| Type |
Description |
| System.Object |
System.Object.
|
Type Parameters
Declaration
protected static T[] TryParseEnums<T>(string value)
where T : struct
Parameters
| Type |
Name |
Description |
| System.String |
value |
|
Returns
Type Parameters
Declaration
protected static T[] TryParseEnums<T>(string[] values)
where T : struct
Parameters
| Type |
Name |
Description |
| System.String[] |
values |
|
Returns
Type Parameters
Implements
Extension Methods