diff --git a/routes/dashboard.py b/routes/dashboard.py index e2e5d86..2fa433e 100644 --- a/routes/dashboard.py +++ b/routes/dashboard.py @@ -117,14 +117,14 @@ def get_farm_data(): for row in rows: d = json.loads(row['data']) farm_data = d.get('farms', []) - ready = [f for f in farm_data if f.get('lootable_at', 0) <= now_ts] + ready = [f for f in farm_data if f.get('lootable_at', 0) <= now_ts and f.get('relation_status', 0) == 1] if farm_data: farms_summary.append({ 'town_id': row['town_id'], 'town_name': row['town_name'], 'total_farms': len(farm_data), 'ready_farms': len(ready), - 'next_ready_at': min((f['lootable_at'] for f in farm_data if f.get('lootable_at', 0) > now_ts), default=None) + 'next_ready_at': min((f['lootable_at'] for f in farm_data if f.get('lootable_at', 0) > now_ts and f.get('relation_status', 0) == 1), default=None) }) return jsonify(farms_summary)