mirror of
https://github.com/jellyfin/jellyfin-plugin-opensubtitles.git
synced 2024-11-23 14:19:50 +00:00
Rename ApiKey to CustomApiKey
This commit is contained in:
parent
bb373c07f1
commit
7481e761d6
@ -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)
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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!;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user