Skip to content

Commit

Permalink
Fixed a bug cause by no buying/selling orders
Browse files Browse the repository at this point in the history
  • Loading branch information
adminerest committed Oct 17, 2021
1 parent 0b88218 commit a0c10f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SteamCommunityItemAutoSell
[![Steam Profile](https://img.shields.io/badge/Steam-adminerest-blue.svg?logo=steam)](https://steamcommunity.com/profiles/76561198139305147/) [![Keylol Profile](https://img.shields.io/badge/Keylol-adminerest-blue.svg?logo=steam)](https://keylol.com/suid-1467452)

[![Version](https://img.shields.io/badge/Version-beta1.1.0-green.svg?logo=github)](https://github.com/adminerest/SteamCommunityItemAutoSell/releases)
[![Version](https://img.shields.io/badge/Version-beta1.1.1-green.svg?logo=github)](https://github.com/adminerest/SteamCommunityItemAutoSell/releases)

[![README.en-US](https://img.shields.io/badge/README-English-yellow.svg?logo=github)](https://github.com/adminerest/SteamCommunityItemAutoSell/blob/master/README.md) [![README.zh-CN](https://img.shields.io/badge/README-中文-yellow.svg?logo=github)](https://github.com/adminerest/SteamCommunityItemAutoSell/blob/master/README.zh-CN.md)

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SteamCommunityItemAutoSell
[![Steam Profile](https://img.shields.io/badge/Steam-adminerest-blue.svg?logo=steam)](https://steamcommunity.com/profiles/76561198139305147/) [![Keylol Profile](https://img.shields.io/badge/Keylol-adminerest-blue.svg?logo=steam)](https://keylol.com/suid-1467452)

[![Version](https://img.shields.io/badge/Version-beta1.1.0-green.svg?logo=github)](https://github.com/adminerest/SteamCommunityItemAutoSell/releases)
[![Version](https://img.shields.io/badge/Version-beta1.1.1-green.svg?logo=github)](https://github.com/adminerest/SteamCommunityItemAutoSell/releases)

[![README.en-US](https://img.shields.io/badge/README-English-yellow.svg?logo=github)](https://github.com/adminerest/SteamCommunityItemAutoSell/blob/master/README.md) [![README.zh-CN](https://img.shields.io/badge/README-中文-yellow.svg?logo=github)](https://github.com/adminerest/SteamCommunityItemAutoSell/blob/master/README.zh-CN.md)

Expand Down
7 changes: 4 additions & 3 deletions price.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ def calculate_price(self) -> None:
"""
highest_buy_price = self.item_price_graph['highest_buy_order']
lowest_sell_price = self.item_price_graph['lowest_sell_order']
total_buy_orders = self.item_price_graph['buy_order_graph'][-1][1]
total_sell_orders = self.item_price_graph['sell_order_graph'][-1][1]
total_buy_orders = self.item_price_graph['buy_order_graph'][-1][1] \
if self.item_price_graph['buy_order_graph'] else 0
total_sell_orders = self.item_price_graph['sell_order_graph'][-1][1] \
if self.item_price_graph['sell_order_graph'] else 0

def get_history_sales_num(hours: int) -> int:
if not isinstance(hours, (int, float)) or hours < 0 or hours > 999999:
Expand Down Expand Up @@ -114,4 +116,3 @@ class CalculationFormulaWrongException(Exception):

class ItemCantSellException(Exception):
"""The item not meet the config setting"""

0 comments on commit a0c10f2

Please sign in to comment.