Skip to content

Commit

Permalink
Possible fix for #15
Browse files Browse the repository at this point in the history
  • Loading branch information
Bond-009 committed Oct 27, 2019
1 parent b377def commit a3221e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ namespace Jellyfin.Plugin.OpenSubtitles.Configuration
{
public class PluginConfiguration : BasePluginConfiguration
{
public string Username { get; set; }
public string Password { get; set; }
public string Username { get; set; } = string.Empty;

public string Password { get; set; } = string.Empty;
}
}
15 changes: 9 additions & 6 deletions Jellyfin.Plugin.OpenSubtitles/OpenSubtitleDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,18 @@ private async Task Login(CancellationToken cancellationToken)
return;
}

var loginResponse = await OpenSubtitlesHandler.OpenSubtitles.LogInAsync(options.Username, options.Password, "en", cancellationToken).ConfigureAwait(false);
var loginResponse = await OpenSubtitlesHandler.OpenSubtitles.LogInAsync(
options.Username,
options.Password,
"en",
cancellationToken).ConfigureAwait(false);

if (loginResponse.Item2 != null)

if (loginResponse.Item2 == 1)
{
if (loginResponse.Item2 == 1)
{
await Task.Delay(1000);
}
await Task.Delay(1000);
}

if (!(loginResponse.Item1 is MethodResponseLogIn))
{
throw new Exception("Authentication to OpenSubtitles failed.");
Expand Down

0 comments on commit a3221e3

Please sign in to comment.