@ -37,9 +37,6 @@ namespace InfoferScraper.Models.Station {
}
public interface IStationStatus : IStatus {
new int Delay { get; }
new bool Real { get; }
public bool Cancelled { get; }
public string? Platform { get; }
@ -6,10 +6,13 @@ namespace InfoferScraper.Models.Status {
/// Determines whether delay was actually reported or is an approximation
/// </summary>
public bool Real { get; }
internal record Status : IStatus {
public int Delay { get; set; }
public bool Real { get; set; }
public bool Cancelled { get; set; }
@ -201,7 +201,12 @@ namespace InfoferScraper.Scrapers {
statusElement.Text().WithCollapsedSpaces(replaceWith: " ")
).Groups as IEnumerable<Group>).Skip(1).Select(group => group.Value);
arrDep.MakeStatus(status => {
if (string.IsNullOrEmpty(onTime) && delay == null) {
status.Cancelled = true;
else {
status.Delay = string.IsNullOrEmpty(onTime) ? int.Parse(delay) : 0;
status.Real = string.IsNullOrEmpty(approx);
});