Skip to content

Commit

Permalink
fix: gog confused claimable and always free games (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
eikowagenknecht authored Oct 25, 2023
1 parent a8871a5 commit d77397a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lootscraper/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ def find_offer(
self,
source: Source,
type_: OfferType,
duration: OfferDuration,
title: str,
valid_to: datetime | None,
) -> Offer | None:
Expand All @@ -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)
)

Expand Down
1 change: 1 addition & 0 deletions src/lootscraper/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
3 changes: 3 additions & 0 deletions src/lootscraper/scraper/scraper_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d77397a

Please sign in to comment.