Skip to content

Commit d9e4643

Browse files
committed
fix uni-test when in mode debug
1 parent d410a1f commit d9e4643

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

DesktopClient/Main.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ private async void ButtonDownload_Click(object sender, EventArgs e)
134134

135135
await DownloadAsync().ConfigureAwait(true);
136136

137+
ChangeControlsState(true);
137138
// force async
138139
//await Task.Yield();
139140
//ChangeControlsStates(false);

src/Http/SubDBApi.cs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,20 @@ public Task<Response> GetAvailableLanguagesAsync()
6161
/// <returns></returns>
6262
public Task<Response> SearchSubtitle(string hash, bool getVersions = false)
6363
{
64-
#if !DEBUG
65-
Uri fullUrl = BaseAddress.ApplySearchSubtitleParameters(hash, getVersions);
64+
65+
Uri fullUrl = _baseAddress.ApplySearchSubtitleParameters(hash, getVersions);
6666
Request request = BuildRequest(fullUrl, HttpMethod.Get, null);
67-
return SendDataAsync(request);
68-
#else
6967
// NOTE: THIS CODE IS ONLY FOR TEST. (SUBDB DOESN'T ENCODED QUERY STRING)
7068
// ONCE THE QUERY STRING IS ENCODED IT'S PUT INSIDE HTTP BODY INSTEAD OF URL
71-
Dictionary<string, string> requestParameters = new Dictionary<string, string>
72-
{
73-
["action"] = "download",
74-
["hash"] = hash,
75-
// TODO: Language.
76-
};
69+
//Dictionary<string, string> requestParameters = new Dictionary<string, string>
70+
//{
71+
// ["action"] = "download",
72+
// ["hash"] = hash,
73+
// // TODO: Language.
74+
//};
75+
//Request request = BuildRequest(new Uri("http://sandbox.thesubdb.com"), HttpMethod.Get, UriExtensions.GetFormURlEncodedContent(requestParameters));
7776

78-
Request request = BuildRequest(null, HttpMethod.Get, UriExtensions.GetFormURlEncodedContent(requestParameters));
7977
return SendDataAsync(request);
80-
#endif
8178
}
8279

8380
/// <summary>

0 commit comments

Comments
 (0)