diff --git a/src/lootscraper/database.py b/src/lootscraper/database.py index 6b5234fc..ba9adca3 100644 --- a/src/lootscraper/database.py +++ b/src/lootscraper/database.py @@ -371,6 +371,7 @@ def find_offer( self, source: Source, type_: OfferType, + duration: OfferDuration, title: str, valid_to: datetime | None, ) -> Offer | None: @@ -383,6 +384,7 @@ def find_offer( sa.select(Offer) .where(Offer.source == source) .where(Offer.type == type_) + .where(Offer.duration == duration) .where(Offer.title == title) ) diff --git a/src/lootscraper/processing.py b/src/lootscraper/processing.py index 73dbb779..2658664e 100644 --- a/src/lootscraper/processing.py +++ b/src/lootscraper/processing.py @@ -86,6 +86,7 @@ async def process_new_offers( existing_entry: Offer | None = db.find_offer( scraped_offer.source, scraped_offer.type, + scraped_offer.duration, scraped_offer.title, scraped_offer.valid_to, ) diff --git a/src/lootscraper/scraper/scraper_base.py b/src/lootscraper/scraper/scraper_base.py index 19593d9e..a38cc583 100644 --- a/src/lootscraper/scraper/scraper_base.py +++ b/src/lootscraper/scraper/scraper_base.py @@ -322,6 +322,9 @@ def is_prerelease(title: str) -> bool: re.IGNORECASE, ): return True + # Used by GOG sometimes + if "Playable Teaser" in title: + return True return False @staticmethod