From 88377e258a2488130410f824d40a632382381ac3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Feb 2026 02:21:24 +0000 Subject: [PATCH] Use CheapShark's native 0-10 scale for MIN_DEAL_RATING MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous 0-100 scale with a * 10 conversion was confusing — CheapShark returns deal ratings as floats (e.g. 9.8, 7.5) so the config should match. Default is now 8.0 instead of 80. https://claude.ai/code/session_01LPpSZFfyh6vdV5HGFWjoQX --- .env.example | 2 +- README.md | 2 +- gaming_deals_bot/cheapshark.py | 2 +- gaming_deals_bot/config.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 59b4c30..63619af 100644 --- a/.env.example +++ b/.env.example @@ -8,7 +8,7 @@ MATRIX_DEALS_ROOM_ID=!roomid:example.com ITAD_API_KEY= # Deal filtering -MIN_DEAL_RATING=80 +MIN_DEAL_RATING=8.0 MIN_DISCOUNT_PERCENT=50 MAX_PRICE_USD=20 diff --git a/README.md b/README.md index eb50c8d..567f7e2 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ All configuration is via environment variables (see `.env.example`): | `MATRIX_BOT_ACCESS_TOKEN` | Yes | — | Bot's access token | | `MATRIX_DEALS_ROOM_ID` | Yes | — | Room ID to post deals in | | `ITAD_API_KEY` | No | — | IsThereAnyDeal API key for historical low detection | -| `MIN_DEAL_RATING` | No | 80 | Minimum CheapShark deal rating (0-100) | +| `MIN_DEAL_RATING` | No | 8.0 | Minimum CheapShark deal rating (0-10) | | `MIN_DISCOUNT_PERCENT` | No | 50 | Minimum discount percentage | | `MAX_PRICE_USD` | No | 20 | Maximum sale price in USD | | `DATABASE_PATH` | No | deals.db | Path to SQLite database file | diff --git a/gaming_deals_bot/cheapshark.py b/gaming_deals_bot/cheapshark.py index a60e983..2037acc 100644 --- a/gaming_deals_bot/cheapshark.py +++ b/gaming_deals_bot/cheapshark.py @@ -75,7 +75,7 @@ async def fetch_deals( if savings < min_discount: continue - if rating * 10 < min_rating: # dealRating is 0-10, config is 0-100 + if rating < min_rating: continue steam_app_id = d.get("steamAppID") or None diff --git a/gaming_deals_bot/config.py b/gaming_deals_bot/config.py index 1db6d35..4c25a9e 100644 --- a/gaming_deals_bot/config.py +++ b/gaming_deals_bot/config.py @@ -15,7 +15,7 @@ class Config: self.itad_api_key = os.environ.get("ITAD_API_KEY", "") # Deal filtering - self.min_deal_rating = int(os.environ.get("MIN_DEAL_RATING", "80")) + self.min_deal_rating = float(os.environ.get("MIN_DEAL_RATING", "8.0")) self.min_discount_percent = int(os.environ.get("MIN_DISCOUNT_PERCENT", "50")) self.max_price_usd = float(os.environ.get("MAX_PRICE_USD", "20"))