mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2025-01-31 13:01:39 +01:00
Add simple retry for DL - thx rifatozkancomtr/dante3732 :)
Work on #8967
This commit is contained in:
parent
f041061a8e
commit
ccbcc300f2
@ -2,7 +2,7 @@
|
||||
<Language Name="English">
|
||||
<General>
|
||||
<Title>Subtitle Edit</Title>
|
||||
<Version>4.0.9</Version>
|
||||
<Version>4.0.10</Version>
|
||||
<TranslatedBy>Translated by Nikse</TranslatedBy>
|
||||
<CultureName>en-US</CultureName>
|
||||
<HelpFile />
|
||||
|
@ -141,6 +141,20 @@ namespace Nikse.SubtitleEdit.Core.AutoTranslate
|
||||
var result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result;
|
||||
var resultContent = result.Content.ReadAsStringAsync().Result;
|
||||
|
||||
if (result.StatusCode == HttpStatusCode.ServiceUnavailable)
|
||||
{
|
||||
Task.Delay(555).Wait();
|
||||
result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result;
|
||||
resultContent = result.Content.ReadAsStringAsync().Result;
|
||||
}
|
||||
|
||||
if (result.StatusCode == HttpStatusCode.ServiceUnavailable)
|
||||
{
|
||||
Task.Delay(1007).Wait();
|
||||
result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result;
|
||||
resultContent = result.Content.ReadAsStringAsync().Result;
|
||||
}
|
||||
|
||||
if (!result.IsSuccessStatusCode)
|
||||
{
|
||||
SeLogger.Error("DeepLTranslate error: " + resultContent);
|
||||
|
@ -57,6 +57,20 @@ namespace Nikse.SubtitleEdit.Core.AutoTranslate
|
||||
var result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result;
|
||||
var resultContent = result.Content.ReadAsStringAsync().Result;
|
||||
|
||||
if (result.StatusCode == HttpStatusCode.ServiceUnavailable)
|
||||
{
|
||||
Task.Delay(555).Wait();
|
||||
result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result;
|
||||
resultContent = result.Content.ReadAsStringAsync().Result;
|
||||
}
|
||||
|
||||
if (result.StatusCode == HttpStatusCode.ServiceUnavailable)
|
||||
{
|
||||
Task.Delay(1007).Wait();
|
||||
result = _client.PostAsync("/v2/translate", postContent, cancellationToken).Result;
|
||||
resultContent = result.Content.ReadAsStringAsync().Result;
|
||||
}
|
||||
|
||||
if (!result.IsSuccessStatusCode)
|
||||
{
|
||||
SeLogger.Error("DeepLTranslate error: " + resultContent);
|
||||
|
@ -2,7 +2,7 @@
|
||||
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json
|
||||
|
||||
PackageIdentifier: Nikse.SubtitleEdit
|
||||
PackageVersion: 4.0.9.0
|
||||
PackageVersion: 4.0.10.0
|
||||
InstallerType: inno
|
||||
FileExtensions:
|
||||
- srt
|
||||
@ -23,8 +23,8 @@ FileExtensions:
|
||||
ProductCode: SubtitleEdit_is1
|
||||
Installers:
|
||||
- Architecture: x64
|
||||
InstallerUrl: https://github.com/SubtitleEdit/subtitleedit/releases/download/4.0.9/SubtitleEdit-4.0.9-Setup.exe
|
||||
InstallerSha256: F1DBC298F29AA28391977869B3955EE07CAF8622FF79C66046D6C90A4D6F77EA
|
||||
InstallerUrl: https://github.com/SubtitleEdit/subtitleedit/releases/download/4.0.10/SubtitleEdit-4.0.10-Setup.exe
|
||||
InstallerSha256: 1677D2E5DABB08EA76B4B32DBCDE302B395AD8D5A613AC34C4E582B3502CC66F
|
||||
ManifestType: installer
|
||||
ManifestVersion: 1.6.0
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json
|
||||
|
||||
PackageIdentifier: Nikse.SubtitleEdit
|
||||
PackageVersion: 4.0.9.0
|
||||
PackageVersion: 4.0.10.0
|
||||
PackageLocale: en-US
|
||||
Publisher: Nikse
|
||||
PublisherUrl: https://www.nikse.dk/
|
||||
|
@ -2,7 +2,7 @@
|
||||
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.6.0.schema.json
|
||||
|
||||
PackageIdentifier: Nikse.SubtitleEdit
|
||||
PackageVersion: 4.0.9.0
|
||||
PackageVersion: 4.0.10.0
|
||||
DefaultLocale: en-US
|
||||
ManifestType: version
|
||||
ManifestVersion: 1.6.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user