fix sde import
This commit is contained in:
@@ -79,7 +79,7 @@ class Type(SQLModel, table=True):
|
||||
name: str
|
||||
published: bool = False
|
||||
description: Optional[str] = None
|
||||
basePrice: float
|
||||
basePrice: Optional[float] = None
|
||||
|
||||
icon_id: Optional[int] = Field(default=None, foreign_key="icon.id")
|
||||
icon: Optional[Icon] = Relationship(back_populates="types")
|
||||
|
||||
@@ -28,6 +28,8 @@ with open("static_eve/sde/fsd/categoryIDs.yaml", "r", encoding="utf-8") as f:
|
||||
|
||||
with Session(sde_engine) as db:
|
||||
for id, category in categories.items():
|
||||
if category["published"] == False:
|
||||
continue
|
||||
db.add(models_sde.Category(id=id,
|
||||
icon_id=category['iconID'] if 'iconID' in category else None,
|
||||
name=category['name']['en'],
|
||||
@@ -41,6 +43,8 @@ with open("static_eve/sde/fsd/groupIDs.yaml", "r", encoding="utf-8") as f:
|
||||
|
||||
with Session(sde_engine) as db:
|
||||
for id, group in groups.items():
|
||||
if group["published"] == False:
|
||||
continue
|
||||
db.add(models_sde.Group(id=id,
|
||||
anchorable=group['anchorable'],
|
||||
anchored=group['anchored'],
|
||||
@@ -76,21 +80,19 @@ with open("static_eve/sde/fsd/typeIDs.yaml", "r", encoding="utf-8") as f:
|
||||
|
||||
with Session(sde_engine) as db:
|
||||
for id, type in types.items():
|
||||
try:
|
||||
db.add(models_sde.Type(id=id,
|
||||
group_id=type['groupID'],
|
||||
marketgroup_id=type['marketGroupID'] if 'marketGroupID' in type else None,
|
||||
name=type['name']['en'],
|
||||
published=type['published'],
|
||||
basePrice=type['basePrice'] if 'basePrice' in type else None,
|
||||
description=type['description']['en'] if 'description' in type else None,
|
||||
icon_id=type['iconID'] if 'iconID' in type else None,
|
||||
portionSize=type['portionSize'],
|
||||
volume=type['volume'] if 'volume' in type else None,
|
||||
))
|
||||
except KeyError:
|
||||
print(type)
|
||||
raise
|
||||
if type["published"] == False:
|
||||
continue
|
||||
db.add(models_sde.Type(id=id,
|
||||
group_id=type['groupID'],
|
||||
marketgroup_id=type['marketGroupID'] if 'marketGroupID' in type else None,
|
||||
name=type['name']['en'],
|
||||
published=type['published'],
|
||||
basePrice=type['basePrice'] if 'basePrice' in type else None,
|
||||
description=type['description']['en'] if 'description' in type else None,
|
||||
icon_id=type['iconID'] if 'iconID' in type else None,
|
||||
portionSize=type['portionSize'],
|
||||
volume=type['volume'] if 'volume' in type else None,
|
||||
))
|
||||
db.commit()
|
||||
|
||||
|
||||
@@ -100,7 +102,7 @@ with open("static_eve/sde/fsd/typeMaterials.yaml", "r", encoding="utf-8") as f:
|
||||
|
||||
with Session(sde_engine) as db:
|
||||
for id, material in materials.items():
|
||||
for mat in material:
|
||||
for mat in material['materials']:
|
||||
db.add(models_sde.TypeMaterial(type_id=id,
|
||||
material_id=mat['materialTypeID'],
|
||||
quantity=mat['quantity']
|
||||
@@ -108,5 +110,4 @@ with Session(sde_engine) as db:
|
||||
db.commit()
|
||||
|
||||
|
||||
|
||||
print("DONE!")
|
||||
@@ -1631297,6 +1631297,9 @@
|
||||
description:
|
||||
de: Nach Einlösung wird dieser SKIN sofort zur SKIN-Sammlung Ihres Charakters
|
||||
hinzugefügt und landet nicht erst in Ihrem Inventar.
|
||||
en: Super Kerr-Induced Nanocoatings (SKINs) are a technology that enables capsuleers to change the look of their ships at will.
|
||||
Individual ship SKINs are activated by integrating the special encoding into the pilot's neural interfaces,
|
||||
and are subsequently available to use on any suitable ship flown by the capsuleer.
|
||||
es: Esta SKIN se añadirá directamente a la colección de tu personaje, en vez
|
||||
de al inventario, tras canjearla.
|
||||
fr: Une fois récupéré, au lieu d'être placé dans votre inventaire, ce SKIN
|
||||
@@ -1696086,6 +1696089,10 @@
|
||||
agierender Elite-Zweig von CONCORDs DED. Ihre Agenten haben die Erlaubnis,
|
||||
vorbeugend auf jegliche potentielle Bedrohungen für ihre Mission zu reagieren,
|
||||
inklusive des sofortigen Eröffnens von Feuer auf Eindringlinge.
|
||||
en: Special Affairs for Regulations & Order (SARO) is an secretive elite branch
|
||||
of CONCORD's Directive Enforcement Department. Their officers are authorized
|
||||
to respond pre-emptively to all potential threats to their missions, up
|
||||
to and including firing on interlopers on sight.
|
||||
es: La Subdivisión de Asuntos para la Regulación y el Orden (SARO) es una
|
||||
sección secreta de élite del Departamento de Ejecución de Directivas de
|
||||
CONCORD. Sus oficiales están autorizados a responder preventivamente a
|
||||
@@ -1696812,6 +1696819,8 @@
|
||||
description:
|
||||
de: Dieses fortschrittliche Schlachtschiff scheint die Kontrolle über das
|
||||
lokale Schmugglerversteck zu haben. Es wird als extrem gefährlich eingestuft.
|
||||
en: This advanced battleship appears to be in charge of the local smuggler
|
||||
hideout. It should be considered extremely dangerous.
|
||||
es: Este acorazado avanzado parece estar a cargo del escondite de los contrabandistas
|
||||
locales. Debería considerarse extremadamente peligroso.
|
||||
fr: Ce cuirassé avancé semble être responsable de la cachette locale des contrebandiers.
|
||||
|
||||
Reference in New Issue
Block a user