Rename ApiKey to CustomApiKey

This commit is contained in:
MBR#0001 2021-11-01 21:00:54 +01:00
parent bb373c07f1
commit 7481e761d6
No known key found for this signature in database
GPG Key ID: A938970B8DD3F170
4 changed files with 7 additions and 7 deletions

View File

@ -38,7 +38,7 @@ namespace Jellyfin.Plugin.OpenSubtitles.API
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
public async Task<ActionResult> ValidateLoginInfo([FromBody] LoginInfoInput body)
{
var key = !string.IsNullOrWhiteSpace(body.ApiKey) ? body.ApiKey : OpenSubtitlesPlugin.ApiKey;
var key = !string.IsNullOrWhiteSpace(body.CustomApiKey) ? body.CustomApiKey : OpenSubtitlesPlugin.ApiKey;
var response = await OpenSubtitlesHandler.OpenSubtitles.LogInAsync(body.Username, body.Password, key, CancellationToken.None).ConfigureAwait(false);
if (!response.Ok)

View File

@ -57,7 +57,7 @@ namespace Jellyfin.Plugin.OpenSubtitles
}
/// <summary>
/// Gets the API key that will be used.
/// Gets the API key that will be used for requests.
/// </summary>
public string ApiKey
{

View File

@ -9,7 +9,7 @@ export default function (view, params) {
ApiClient.getPluginConfiguration(OpenSubtitlesConfig.pluginUniqueId).then(function (config) {
page.querySelector('#username').value = config.Username || '';
page.querySelector('#password').value = config.Password || '';
page.querySelector('#apikey').value = config.ApiKey || '';
page.querySelector('#apikey').value = config.CustomApiKey || '';
Dashboard.hideLoadingMsg();
});
});
@ -30,7 +30,7 @@ export default function (view, params) {
const el = form.querySelector('#ossresponse');
const data = JSON.stringify({ Username: username, Password: password, ApiKey: apiKey });
const data = JSON.stringify({ Username: username, Password: password, CustomApiKey: apiKey });
const url = ApiClient.getUrl('Jellyfin.Plugin.OpenSubtitles/ValidateLoginInfo');
const handler = response => response.json().then(res => {
@ -39,7 +39,7 @@ export default function (view, params) {
config.Username = username;
config.Password = password;
config.ApiKey = apiKey;
config.CustomApiKey = apiKey;
ApiClient.updatePluginConfiguration(OpenSubtitlesConfig.pluginUniqueId, config).then(function (result) {
Dashboard.processPluginConfigurationUpdateResult(result);

View File

@ -20,8 +20,8 @@ namespace OpenSubtitlesHandler.Models
public string Password { get; set; } = null!;
/// <summary>
/// Gets or sets the api key.
/// Gets or sets the custom api key.
/// </summary>
public string ApiKey { get; set; } = null!;
public string CustomApiKey { get; set; } = null!;
}
}