Added setting for max steam offer count

This commit is contained in:
2023-11-04 23:37:07 +01:00
parent e6165caed9
commit dcbb481b10
20 changed files with 106 additions and 9 deletions

View File

@@ -21,6 +21,7 @@ from bot_data.abc.steam_special_offer_repository_abc import (
)
from bot_data.model.server_config import ServerConfig
from bot_data.model.steam_special_offer import SteamSpecialOffer
from bot_data.model.technician_config import TechnicianConfig
class SteamOfferWatcher(TaskABC):
@@ -33,6 +34,7 @@ class SteamOfferWatcher(TaskABC):
offers: SteamSpecialOfferRepositoryABC,
message_service: MessageService,
t: TranslatePipe,
tech_config: TechnicianConfig,
):
TaskABC.__init__(self)
@@ -43,6 +45,7 @@ class SteamOfferWatcher(TaskABC):
self._bot = bot
self._message_service = message_service
self._t = t
self._tech_config = tech_config
self._is_new = False
self._urls = {}
@@ -108,8 +111,7 @@ class SteamOfferWatcher(TaskABC):
def _get_new_game_offers(self) -> List[SteamSpecialOffer]:
new_offers = List(SteamSpecialOffer)
# sale_count = self._get_max_count() + 100
sale_count = 150
sale_count = self._tech_config.max_steam_offer_count
# todo: let admins change the value
self._logger.debug(__name__, f"Get special offers from 0 to {sale_count}")
for i in range(0, sale_count, 100):