mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
support adding connect user
This commit is contained in:
@@ -1085,6 +1085,34 @@ namespace MediaBrowser.Server.Implementations.Connect
|
||||
}
|
||||
}
|
||||
|
||||
public async Task AddConnectSupporter(string id)
|
||||
{
|
||||
if (!_securityManager.IsMBSupporter)
|
||||
{
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
var url = GetConnectUrl("keyAssociation");
|
||||
|
||||
url += "?serverId=" + ConnectServerId;
|
||||
url += "&supporterKey=" + _securityManager.SupporterKey;
|
||||
url += "&userId=" + id;
|
||||
|
||||
var options = new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
CancellationToken = CancellationToken.None
|
||||
};
|
||||
|
||||
SetServerAccessToken(options);
|
||||
SetApplicationHeader(options);
|
||||
|
||||
// No need to examine the response
|
||||
using (var stream = (await _httpClient.SendAsync(options, "POST").ConfigureAwait(false)).Content)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RemoveConnectSupporter(string id)
|
||||
{
|
||||
if (!_securityManager.IsMBSupporter)
|
||||
|
||||
Reference in New Issue
Block a user