Fix builds

This commit is contained in:
Patrick Barron 2021-04-10 17:11:59 -04:00
parent 3ebc047434
commit ed0b5ff017
5 changed files with 20 additions and 11 deletions

View File

@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Jellyfin.Data.Entities.Security
{
@ -31,6 +32,10 @@ namespace Jellyfin.Data.Entities.Security
User = null!;
}
/// <summary>
/// Gets the id.
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>

View File

@ -15,6 +15,9 @@ using Microsoft.EntityFrameworkCore;
namespace Jellyfin.Server.Implementations.Devices
{
/// <summary>
/// Manages the creation, updating, and retrieval of devices.
/// </summary>
public class DeviceManager : IDeviceManager
{
private readonly JellyfinDbProvider _dbProvider;
@ -63,9 +66,9 @@ namespace Jellyfin.Server.Implementations.Devices
}
/// <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
: new ClientCapabilities();
}
@ -112,7 +115,7 @@ namespace Jellyfin.Server.Implementations.Devices
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);
}

View File

@ -52,14 +52,15 @@ namespace Jellyfin.Server.Implementations.Security
}
/// <inheritdoc />
public async Task DeleteApiKey(Guid id)
public async Task DeleteApiKey(Guid accessToken)
{
await using var dbContext = _dbProvider.CreateContext();
var key = await dbContext.ApiKeys
.AsQueryable()
.Where(apiKey => apiKey.AccessToken == id)
.FirstOrDefaultAsync();
.Where(apiKey => apiKey.AccessToken == accessToken)
.FirstOrDefaultAsync()
.ConfigureAwait(false);
if (key == null)
{

View File

@ -295,7 +295,7 @@ namespace Jellyfin.Server.Implementations.Users
}
user.EasyPassword = newPasswordSha1;
await UpdateUserAsync(user);
await UpdateUserAsync(user).ConfigureAwait(false);
_eventManager.Publish(new UserPasswordChangedEventArgs(user));
}

View File

@ -18,16 +18,16 @@ namespace MediaBrowser.Controller.Devices
/// <summary>
/// Saves the capabilities.
/// </summary>
/// <param name="reportedId">The reported identifier.</param>
/// <param name="deviceId">The device id.</param>
/// <param name="capabilities">The capabilities.</param>
void SaveCapabilities(string reportedId, ClientCapabilities capabilities);
void SaveCapabilities(string deviceId, ClientCapabilities capabilities);
/// <summary>
/// Gets the capabilities.
/// </summary>
/// <param name="reportedId">The reported identifier.</param>
/// <param name="deviceId">The device id.</param>
/// <returns>ClientCapabilities.</returns>
ClientCapabilities GetCapabilities(string reportedId);
ClientCapabilities GetCapabilities(string deviceId);
/// <summary>
/// Gets the device information.