Exemplo n.º 1
0
        private async Task <List <Message> > CheckBafuSpots()
        {
            var messages  = new List <Message>();
            var bafuSpots = await _databaseService.GetAllBafuSurfSpotsAsync();

            foreach (var bafuSpot in bafuSpots)
            {
                BafuData bafuData = await _bafuDataProvider.GetOutflowData(bafuSpot.Url);

                if (_bafuEvaluator.IsFiring(bafuData, bafuSpot))
                {
                    messages.Add(new Message()
                    {
                        Dates = bafuData.Dates, SpotName = bafuSpot.Name, SpotUrl = bafuSpot.Url
                    });
                }
            }
            return(messages);
        }
Exemplo n.º 2
0
 public bool IsFiring(BafuData bafuData, BafuSurfSpot bafuSurfSpot)
 {
     return(bafuData.OutflowCurrent > bafuSurfSpot.Outflow || bafuData.OutflowMax24hours > bafuSurfSpot.Outflow);
 }