mirror of https://github.com/jellyfin/jellyfin.git
Fix builds
This commit is contained in:
parent
3ebc047434
commit
ed0b5ff017
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace Jellyfin.Data.Entities.Security
|
namespace Jellyfin.Data.Entities.Security
|
||||||
{
|
{
|
||||||
|
@ -31,6 +32,10 @@ namespace Jellyfin.Data.Entities.Security
|
||||||
User = null!;
|
User = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the id.
|
||||||
|
/// </summary>
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -15,6 +15,9 @@ using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace Jellyfin.Server.Implementations.Devices
|
namespace Jellyfin.Server.Implementations.Devices
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Manages the creation, updating, and retrieval of devices.
|
||||||
|
/// </summary>
|
||||||
public class DeviceManager : IDeviceManager
|
public class DeviceManager : IDeviceManager
|
||||||
{
|
{
|
||||||
private readonly JellyfinDbProvider _dbProvider;
|
private readonly JellyfinDbProvider _dbProvider;
|
||||||
|
@ -63,9 +66,9 @@ namespace Jellyfin.Server.Implementations.Devices
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public ClientCapabilities GetCapabilities(string id)
|
public ClientCapabilities GetCapabilities(string deviceId)
|
||||||
{
|
{
|
||||||
return _capabilitiesMap.TryGetValue(id, out ClientCapabilities? result)
|
return _capabilitiesMap.TryGetValue(deviceId, out ClientCapabilities? result)
|
||||||
? result
|
? result
|
||||||
: new ClientCapabilities();
|
: new ClientCapabilities();
|
||||||
}
|
}
|
||||||
|
@ -112,7 +115,7 @@ namespace Jellyfin.Server.Implementations.Devices
|
||||||
sessions = sessions.Where(i => CanAccessDevice(user, i.DeviceId));
|
sessions = sessions.Where(i => CanAccessDevice(user, i.DeviceId));
|
||||||
}
|
}
|
||||||
|
|
||||||
var array = await sessions.Select(ToDeviceInfo).ToArrayAsync();
|
var array = await sessions.Select(ToDeviceInfo).ToArrayAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
return new QueryResult<DeviceInfo>(array);
|
return new QueryResult<DeviceInfo>(array);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,14 +52,15 @@ namespace Jellyfin.Server.Implementations.Security
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public async Task DeleteApiKey(Guid id)
|
public async Task DeleteApiKey(Guid accessToken)
|
||||||
{
|
{
|
||||||
await using var dbContext = _dbProvider.CreateContext();
|
await using var dbContext = _dbProvider.CreateContext();
|
||||||
|
|
||||||
var key = await dbContext.ApiKeys
|
var key = await dbContext.ApiKeys
|
||||||
.AsQueryable()
|
.AsQueryable()
|
||||||
.Where(apiKey => apiKey.AccessToken == id)
|
.Where(apiKey => apiKey.AccessToken == accessToken)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync()
|
||||||
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
if (key == null)
|
if (key == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -295,7 +295,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
}
|
}
|
||||||
|
|
||||||
user.EasyPassword = newPasswordSha1;
|
user.EasyPassword = newPasswordSha1;
|
||||||
await UpdateUserAsync(user);
|
await UpdateUserAsync(user).ConfigureAwait(false);
|
||||||
|
|
||||||
_eventManager.Publish(new UserPasswordChangedEventArgs(user));
|
_eventManager.Publish(new UserPasswordChangedEventArgs(user));
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,16 +18,16 @@ namespace MediaBrowser.Controller.Devices
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves the capabilities.
|
/// Saves the capabilities.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reportedId">The reported identifier.</param>
|
/// <param name="deviceId">The device id.</param>
|
||||||
/// <param name="capabilities">The capabilities.</param>
|
/// <param name="capabilities">The capabilities.</param>
|
||||||
void SaveCapabilities(string reportedId, ClientCapabilities capabilities);
|
void SaveCapabilities(string deviceId, ClientCapabilities capabilities);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the capabilities.
|
/// Gets the capabilities.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="reportedId">The reported identifier.</param>
|
/// <param name="deviceId">The device id.</param>
|
||||||
/// <returns>ClientCapabilities.</returns>
|
/// <returns>ClientCapabilities.</returns>
|
||||||
ClientCapabilities GetCapabilities(string reportedId);
|
ClientCapabilities GetCapabilities(string deviceId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the device information.
|
/// Gets the device information.
|
||||||
|
|
Loading…
Reference in New Issue