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
AuthorizationContext
Declaration
public IAuthorizationContext AuthorizationContext { 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 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, ILibraryManager libraryManager)
Parameters
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, ILibraryManager libraryManager)
Parameters
Returns
Declaration
protected Genre GetGenre(string name, ILibraryManager libraryManager)
Parameters
Returns
Declaration
public string GetHeader(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
Type |
Description |
System.String |
|
Gets the name of the item by.
Declaration
protected BaseItem GetItemByName(string name, string type, ILibraryManager libraryManager)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.String |
type |
|
ILibraryManager |
libraryManager |
|
Returns
Declaration
protected InternalItemsQuery GetItemsQuery(BaseItem parentItem, BaseItemsRequest request, DtoOptions dtoOptions, User user, ILibraryManager libraryManager, ILocalizationManager localization)
Parameters
Returns
Declaration
protected MusicGenre GetMusicGenre(string name, ILibraryManager libraryManager)
Parameters
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, ILibraryManager libraryManager)
Parameters
Returns
Declaration
protected BaseItem GetQueryParent(string parentId, User user)
Parameters
Type |
Name |
Description |
System.String |
parentId |
|
User |
user |
|
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, ILibraryManager libraryManager)
Parameters
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(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[] ParseIds(string value, ILibraryManager libraryManager)
Parameters
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
Implements
Extension Methods