mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 09:00:13 +00:00
Add changelog during update
Thanks @Abrynos
This commit is contained in:
@@ -197,6 +197,14 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(releaseResponse.ReleaseNotesInMarkdown)) {
|
||||||
|
string plainText = Utilities.MarkdownToText(releaseResponse.ReleaseNotesInMarkdown);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(plainText)) {
|
||||||
|
ArchiLogger.LogGenericInfo(string.Format(Strings.UpdateChangelog, plainText));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ArchiLogger.LogGenericInfo(string.Format(Strings.UpdateDownloadingNewVersion, newVersion, binaryAsset.Size / 1024 / 1024));
|
ArchiLogger.LogGenericInfo(string.Format(Strings.UpdateDownloadingNewVersion, newVersion, binaryAsset.Size / 1024 / 1024));
|
||||||
|
|
||||||
WebBrowser.BinaryResponse response = await Program.WebBrowser.UrlGetToBinaryWithProgress(binaryAsset.DownloadURL).ConfigureAwait(false);
|
WebBrowser.BinaryResponse response = await Program.WebBrowser.UrlGetToBinaryWithProgress(binaryAsset.DownloadURL).ConfigureAwait(false);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
|
|||||||
return BadRequest(new GenericResponse<string>(false, string.Format(Strings.ErrorIsEmpty, nameof(text))));
|
return BadRequest(new GenericResponse<string>(false, string.Format(Strings.ErrorIsEmpty, nameof(text))));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ok(new GenericResponse<string>(ArchiSteamFarm.Utilities.MarkdownToText(text)));
|
return Ok(new GenericResponse<string>(Utilities.MarkdownToText(text)));
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("Send")]
|
[HttpPost("Send")]
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ namespace ArchiSteamFarm.JSON {
|
|||||||
[JsonProperty(PropertyName = "assets", Required = Required.Always)]
|
[JsonProperty(PropertyName = "assets", Required = Required.Always)]
|
||||||
internal readonly HashSet<Asset> Assets;
|
internal readonly HashSet<Asset> Assets;
|
||||||
|
|
||||||
|
[JsonProperty(PropertyName = "body", Required = Required.Always)]
|
||||||
|
internal readonly string ReleaseNotesInMarkdown;
|
||||||
|
|
||||||
[JsonProperty(PropertyName = "tag_name", Required = Required.Always)]
|
[JsonProperty(PropertyName = "tag_name", Required = Required.Always)]
|
||||||
internal readonly string Tag;
|
internal readonly string Tag;
|
||||||
|
|
||||||
|
|||||||
10
ArchiSteamFarm/Localization/Strings.Designer.cs
generated
10
ArchiSteamFarm/Localization/Strings.Designer.cs
generated
@@ -1251,6 +1251,16 @@ namespace ArchiSteamFarm.Localization {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Changelog:
|
||||||
|
///{0}.
|
||||||
|
/// </summary>
|
||||||
|
internal static string UpdateChangelog {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("UpdateChangelog", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Checking for new version....
|
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Checking for new version....
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -658,4 +658,9 @@ StackTrace:
|
|||||||
<value>Workaround for {0} bug has been triggered.</value>
|
<value>Workaround for {0} bug has been triggered.</value>
|
||||||
<comment>{0} will be replaced by the bug's name provided by ASF</comment>
|
<comment>{0} will be replaced by the bug's name provided by ASF</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="UpdateChangelog" xml:space="preserve">
|
||||||
|
<value>Changelog:
|
||||||
|
{0}</value>
|
||||||
|
<comment>{0} will be replaced by complete changelog text from GitHub (in english). Please note that this string should include newlines for formatting.</comment>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -30,6 +30,7 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Localisation;
|
using Humanizer.Localisation;
|
||||||
|
using Markdig;
|
||||||
|
|
||||||
namespace ArchiSteamFarm {
|
namespace ArchiSteamFarm {
|
||||||
internal static class Utilities {
|
internal static class Utilities {
|
||||||
@@ -183,7 +184,7 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
string plainText = Markdig.Markdown.ToPlainText(markdownText);
|
string plainText = Markdown.ToPlainText(markdownText);
|
||||||
if (plainText == null) {
|
if (plainText == null) {
|
||||||
ASF.ArchiLogger.LogNullError(nameof(plainText));
|
ASF.ArchiLogger.LogNullError(nameof(plainText));
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user