Kaynağa Gözat

punoted.storage: fix names

it's actually JSON null now, not "null"
raylu 1 hafta önce
ebeveyn
işleme
afcc8b467f
1 değiştirilmiş dosya ile 1 ekleme ve 3 silme
  1. 1 3
      punoted/storage.py

+ 1 - 3
punoted/storage.py

@@ -14,9 +14,7 @@ def main():
 	for storage in storages:
 		for item in storage['StorageItems']:
 			if item['MaterialTicker'] in items:
-				name = storage['Name']
-				if name == 'null':
-					name = storage['Location']
+				name = storage['Name'] or storage['Location']
 				print(f'{name}: {item["MaterialAmount"]} {item["MaterialTicker"]}')
 
 class Storage(typing.TypedDict):