Skip to content

Commit

Permalink
Merge pull request #33 from Valyreon/develop
Browse files Browse the repository at this point in the history
#26 Force default endpoint on search
Valyreon authored Nov 4, 2024
2 parents 964d3cf + 393ca64 commit 9c4b50a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SubloaderWpf/Services/OpenSubtitlesService.cs
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ public async Task<bool> LogoutAsync()
Page = currentPage
};

using var newClient = GetClient();
using var newClient = GetClient(forceDefaultUrl: true);

var result = await newClient.SearchAsync(parameters);

@@ -158,12 +158,12 @@ private static async Task<byte[]> GetRawFileAsync(string url)
: null;
}

private OpenSubtitlesClient GetClient()
private OpenSubtitlesClient GetClient(bool forceDefaultUrl = false)
{
return new OpenSubtitlesClient(
App.APIKey,
_settings.Value.LoggedInUser?.Token,
_settings.Value.LoggedInUser?.IsVIP == true ? BaseUrlType.VIP : BaseUrlType.Default);
_settings.Value.LoggedInUser?.IsVIP == true && !forceDefaultUrl ? BaseUrlType.VIP : BaseUrlType.Default);
}

private string GetDestinationPath(string CurrentPath, string languageCode, string format)

0 comments on commit 9c4b50a

Please sign in to comment.