I ❤️ @Aareksio

This commit is contained in:
JustArchi
2018-11-07 13:47:45 +01:00
parent 67df99f535
commit a872136a1d
2 changed files with 11 additions and 1 deletions

View File

@@ -106,7 +106,16 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
[ProducesResponseType(typeof(GenericResponse<Version>), 200)]
public async Task<ActionResult<GenericResponse<Version>>> UpdatePost() {
(bool success, Version version) = await Actions.Update().ConfigureAwait(false);
return Ok(new GenericResponse<Version>(success, version));
GenericResponse<Version> response;
if (!success && (version != null) && (SharedInfo.Version >= version)) {
response = new GenericResponse<Version>(false, SharedInfo.Version + " ≥ " + version, version);
} else {
response = new GenericResponse<Version>(success, version);
}
return Ok(response);
}
}
}

View File

@@ -37,6 +37,7 @@ namespace ArchiSteamFarm.IPC.Responses {
internal GenericResponse(T result) : base(result != null) => Result = result;
internal GenericResponse(bool success, string message) : base(success, message) { }
internal GenericResponse(bool success, T result) : base(success) => Result = result;
internal GenericResponse(bool success, string message, T result) : base(success, message) => Result = result;
}
public class GenericResponse {