Эх сурвалжийг харах

sell: exclude items consumed intra-planet

raylu 3 долоо хоног өмнө
parent
commit
3e094a650a
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      sell.py

+ 2 - 1
sell.py

@@ -16,7 +16,8 @@ def main() -> None:
 
 	planets: typing.Sequence[supply.FIOBurn] = cache.get('https://rest.fnar.net/fioweb/burn/user/' + config.username,
 			headers={'Authorization': config.fio_api_key})
-	producing = frozenset(mat['MaterialTicker'] for planet in planets for mat in planet['OrderProduction'])
+	producing = frozenset(mat['MaterialTicker'] for planet in planets for mat in planet['OrderProduction']
+			if mat['MaterialTicker'] not in (c['MaterialTicker'] for c in planet['OrderConsumption']))
 	materials = []
 	for mat in producing:
 		price = raw_prices[mat]