Skip to content

Commit

Permalink
add summoner engravings and change data fill strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
gogodr committed Jan 7, 2023
1 parent 1c873f9 commit 4449f05
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


class Config(metaclass=Singleton):
version = "0.8.15.1"
version = "0.8.16.1"
region: str
game_region: str
debug = False
Expand Down
10 changes: 8 additions & 2 deletions modules/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def add_entry(self, market_line: MarketLine, retries: int = 0):
# Update rarity based on market dictionary
market_line.rarity = item['rarity']

# Fill info if missing
if market_line.recent_price is None:
market_line.recent_price = market_line.lowest_price
if market_line.avg_price is None:
market_line.avg_price = market_line.lowest_price

# Get Doc
item_doc_ref = self.db.document(
f"{Config().region}/{slugify(item['name'])}-{market_line.rarity}")
Expand Down Expand Up @@ -103,10 +109,10 @@ def add_entry(self, market_line: MarketLine, retries: int = 0):
item_doc_ref.update(to_update)

item_doc_ref.collection('entries').add({
'avgPrice': market_line.avg_price if market_line.avg_price is not None else market_line.lowest_price,
'avgPrice': market_line.avg_price,
'cheapestRemaining': market_line.cheapest_remaining,
'lowPrice': market_line.lowest_price,
'recentPrice': market_line.recent_price if market_line.recent_price is not None else market_line.lowest_price,
'recentPrice': market_line.recent_price,
'createdAt': datetime.utcnow(),
'author': Config().uid,
'watcher_version': Config().version
Expand Down
12 changes: 12 additions & 0 deletions modules/market_data/engraving_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,18 @@
'category': 'Engraving Recipe',
'subcategory': None
},
'[Summoner] Communication ...': {
'name': '[Summoner] Communication Overflow Engraving Recipe',
'amount': 1,
'category': 'Engraving Recipe',
'subcategory': None
},
'[Summoner] Master Summoner ...': {
'name': '[Summoner] Master Summoner Engraving Recipe',
'amount': 1,
'category': 'Engraving Recipe',
'subcategory': None
},
'Adrenaline Engraving Recipe': {
'name': 'Adrenaline Engraving Recipe',
'amount': 1,
Expand Down

0 comments on commit 4449f05

Please sign in to comment.