mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-05 00:20:08 +00:00
Add changelog during update
Thanks @Abrynos
This commit is contained in:
@@ -197,6 +197,14 @@ namespace ArchiSteamFarm {
|
||||
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));
|
||||
|
||||
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 Ok(new GenericResponse<string>(ArchiSteamFarm.Utilities.MarkdownToText(text)));
|
||||
return Ok(new GenericResponse<string>(Utilities.MarkdownToText(text)));
|
||||
}
|
||||
|
||||
[HttpPost("Send")]
|
||||
|
||||
@@ -30,6 +30,9 @@ namespace ArchiSteamFarm.JSON {
|
||||
[JsonProperty(PropertyName = "assets", Required = Required.Always)]
|
||||
internal readonly HashSet<Asset> Assets;
|
||||
|
||||
[JsonProperty(PropertyName = "body", Required = Required.Always)]
|
||||
internal readonly string ReleaseNotesInMarkdown;
|
||||
|
||||
[JsonProperty(PropertyName = "tag_name", Required = Required.Always)]
|
||||
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>
|
||||
/// Wyszukuje zlokalizowany ciąg podobny do ciągu Checking for new version....
|
||||
/// </summary>
|
||||
|
||||
@@ -658,4 +658,9 @@ StackTrace:
|
||||
<value>Workaround for {0} bug has been triggered.</value>
|
||||
<comment>{0} will be replaced by the bug's name provided by ASF</comment>
|
||||
</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>
|
||||
@@ -30,6 +30,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Humanizer;
|
||||
using Humanizer.Localisation;
|
||||
using Markdig;
|
||||
|
||||
namespace ArchiSteamFarm {
|
||||
internal static class Utilities {
|
||||
@@ -183,7 +184,7 @@ namespace ArchiSteamFarm {
|
||||
return null;
|
||||
}
|
||||
|
||||
string plainText = Markdig.Markdown.ToPlainText(markdownText);
|
||||
string plainText = Markdown.ToPlainText(markdownText);
|
||||
if (plainText == null) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(plainText));
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user