mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-09 07:10:34 +02:00
Schedules Direct requires the hex to be lowercase
This commit is contained in:
parent
8c8a71692e
commit
38932fc7d1
|
@ -647,7 +647,9 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
||||||
{
|
{
|
||||||
using var options = new HttpRequestMessage(HttpMethod.Post, ApiUrl + "/token");
|
using var options = new HttpRequestMessage(HttpMethod.Post, ApiUrl + "/token");
|
||||||
var hashedPasswordBytes = _cryptoProvider.ComputeHash("SHA1", Encoding.ASCII.GetBytes(password), Array.Empty<byte>());
|
var hashedPasswordBytes = _cryptoProvider.ComputeHash("SHA1", Encoding.ASCII.GetBytes(password), Array.Empty<byte>());
|
||||||
string hashedPassword = Convert.ToHexString(hashedPasswordBytes);
|
// TODO: remove ToLower when Convert.ToHexString supports lowercase
|
||||||
|
// Schedules Direct requires the hex to be lowercase
|
||||||
|
string hashedPassword = Convert.ToHexString(hashedPasswordBytes).ToLowerInvariant();
|
||||||
options.Content = new StringContent("{\"username\":\"" + username + "\",\"password\":\"" + hashedPassword + "\"}", Encoding.UTF8, MediaTypeNames.Application.Json);
|
options.Content = new StringContent("{\"username\":\"" + username + "\",\"password\":\"" + hashedPassword + "\"}", Encoding.UTF8, MediaTypeNames.Application.Json);
|
||||||
|
|
||||||
using var response = await Send(options, false, null, cancellationToken).ConfigureAwait(false);
|
using var response = await Send(options, false, null, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
|
@ -1014,7 +1014,9 @@ namespace Jellyfin.Api.Controllers
|
||||||
if (!string.IsNullOrEmpty(pw))
|
if (!string.IsNullOrEmpty(pw))
|
||||||
{
|
{
|
||||||
using var sha = SHA1.Create();
|
using var sha = SHA1.Create();
|
||||||
listingsProviderInfo.Password = Convert.ToHexString(sha.ComputeHash(Encoding.UTF8.GetBytes(pw)));
|
// TODO: remove ToLower when Convert.ToHexString supports lowercase
|
||||||
|
// Schedules Direct requires the hex to be lowercase
|
||||||
|
listingsProviderInfo.Password = Convert.ToHexString(sha.ComputeHash(Encoding.UTF8.GetBytes(pw))).ToLowerInvariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
return await _liveTvManager.SaveListingProvider(listingsProviderInfo, validateLogin, validateListings).ConfigureAwait(false);
|
return await _liveTvManager.SaveListingProvider(listingsProviderInfo, validateLogin, validateListings).ConfigureAwait(false);
|
||||||
|
|
Loading…
Reference in a new issue