diff --git a/src/Data/Subscriptions/Models/PvPSubscription.cs b/src/Data/Subscriptions/Models/PvPSubscription.cs index 45ae1c75..68ad30ce 100644 --- a/src/Data/Subscriptions/Models/PvPSubscription.cs +++ b/src/Data/Subscriptions/Models/PvPSubscription.cs @@ -94,7 +94,7 @@ public PvPSubscription() League = PvPLeague.Great; MinimumRank = 25; MinimumPercent = 90; - City = "all"; + City = null;// "all"; } } } \ No newline at end of file diff --git a/src/Data/Subscriptions/SubscriptionProcessor.cs b/src/Data/Subscriptions/SubscriptionProcessor.cs index 2c775c18..c372f1cb 100644 --- a/src/Data/Subscriptions/SubscriptionProcessor.cs +++ b/src/Data/Subscriptions/SubscriptionProcessor.cs @@ -314,14 +314,14 @@ public async Task ProcessPvPSubscription(PokemonData pkmn) continue; } - matchesGreat = pkmn.GreatLeague?.Exists(x => subscribedPokemon.League == PvPLeague.Great && - (x.CP ?? 0) >= 2400 && (x.CP ?? 0) <= 2500 && + matchesGreat = pkmn.GreatLeague != null && (pkmn.GreatLeague?.Exists(x => subscribedPokemon.League == PvPLeague.Great && + (x.CP ?? 0) >= 1400 && (x.CP ?? 0) <= 1500 && (x.Rank ?? 4096) <= subscribedPokemon.MinimumRank && - (x.Percentage ?? 0) >= subscribedPokemon.MinimumPercent) ?? false; - matchesUltra = pkmn.GreatLeague?.Exists(x => subscribedPokemon.League == PvPLeague.Ultra && + (x.Percentage ?? 0) * 100 >= subscribedPokemon.MinimumPercent) ?? false); + matchesUltra = pkmn.UltraLeague != null && (pkmn.GreatLeague?.Exists(x => subscribedPokemon.League == PvPLeague.Ultra && (x.CP ?? 0) >= 2400 && (x.CP ?? 0) <= 2500 && (x.Rank ?? 4096) <= subscribedPokemon.MinimumRank && - (x.Percentage ?? 0) >= subscribedPokemon.MinimumPercent) ?? false; + (x.Percentage ?? 0) * 100 >= subscribedPokemon.MinimumPercent) ?? false); if (!matchesGreat && !matchesUltra) continue;