fix sde import
This commit is contained in:
@@ -79,7 +79,7 @@ class Type(SQLModel, table=True):
|
|||||||
name: str
|
name: str
|
||||||
published: bool = False
|
published: bool = False
|
||||||
description: Optional[str] = None
|
description: Optional[str] = None
|
||||||
basePrice: float
|
basePrice: Optional[float] = None
|
||||||
|
|
||||||
icon_id: Optional[int] = Field(default=None, foreign_key="icon.id")
|
icon_id: Optional[int] = Field(default=None, foreign_key="icon.id")
|
||||||
icon: Optional[Icon] = Relationship(back_populates="types")
|
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:
|
with Session(sde_engine) as db:
|
||||||
for id, category in categories.items():
|
for id, category in categories.items():
|
||||||
|
if category["published"] == False:
|
||||||
|
continue
|
||||||
db.add(models_sde.Category(id=id,
|
db.add(models_sde.Category(id=id,
|
||||||
icon_id=category['iconID'] if 'iconID' in category else None,
|
icon_id=category['iconID'] if 'iconID' in category else None,
|
||||||
name=category['name']['en'],
|
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:
|
with Session(sde_engine) as db:
|
||||||
for id, group in groups.items():
|
for id, group in groups.items():
|
||||||
|
if group["published"] == False:
|
||||||
|
continue
|
||||||
db.add(models_sde.Group(id=id,
|
db.add(models_sde.Group(id=id,
|
||||||
anchorable=group['anchorable'],
|
anchorable=group['anchorable'],
|
||||||
anchored=group['anchored'],
|
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:
|
with Session(sde_engine) as db:
|
||||||
for id, type in types.items():
|
for id, type in types.items():
|
||||||
try:
|
if type["published"] == False:
|
||||||
db.add(models_sde.Type(id=id,
|
continue
|
||||||
group_id=type['groupID'],
|
db.add(models_sde.Type(id=id,
|
||||||
marketgroup_id=type['marketGroupID'] if 'marketGroupID' in type else None,
|
group_id=type['groupID'],
|
||||||
name=type['name']['en'],
|
marketgroup_id=type['marketGroupID'] if 'marketGroupID' in type else None,
|
||||||
published=type['published'],
|
name=type['name']['en'],
|
||||||
basePrice=type['basePrice'] if 'basePrice' in type else None,
|
published=type['published'],
|
||||||
description=type['description']['en'] if 'description' in type else None,
|
basePrice=type['basePrice'] if 'basePrice' in type else None,
|
||||||
icon_id=type['iconID'] if 'iconID' in type else None,
|
description=type['description']['en'] if 'description' in type else None,
|
||||||
portionSize=type['portionSize'],
|
icon_id=type['iconID'] if 'iconID' in type else None,
|
||||||
volume=type['volume'] if 'volume' in type else None,
|
portionSize=type['portionSize'],
|
||||||
))
|
volume=type['volume'] if 'volume' in type else None,
|
||||||
except KeyError:
|
))
|
||||||
print(type)
|
|
||||||
raise
|
|
||||||
db.commit()
|
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:
|
with Session(sde_engine) as db:
|
||||||
for id, material in materials.items():
|
for id, material in materials.items():
|
||||||
for mat in material:
|
for mat in material['materials']:
|
||||||
db.add(models_sde.TypeMaterial(type_id=id,
|
db.add(models_sde.TypeMaterial(type_id=id,
|
||||||
material_id=mat['materialTypeID'],
|
material_id=mat['materialTypeID'],
|
||||||
quantity=mat['quantity']
|
quantity=mat['quantity']
|
||||||
@@ -108,5 +110,4 @@ with Session(sde_engine) as db:
|
|||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print("DONE!")
|
print("DONE!")
|
||||||
@@ -1631297,6 +1631297,9 @@
|
|||||||
description:
|
description:
|
||||||
de: Nach Einlösung wird dieser SKIN sofort zur SKIN-Sammlung Ihres Charakters
|
de: Nach Einlösung wird dieser SKIN sofort zur SKIN-Sammlung Ihres Charakters
|
||||||
hinzugefügt und landet nicht erst in Ihrem Inventar.
|
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
|
es: Esta SKIN se añadirá directamente a la colección de tu personaje, en vez
|
||||||
de al inventario, tras canjearla.
|
de al inventario, tras canjearla.
|
||||||
fr: Une fois récupéré, au lieu d'être placé dans votre inventaire, ce SKIN
|
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,
|
agierender Elite-Zweig von CONCORDs DED. Ihre Agenten haben die Erlaubnis,
|
||||||
vorbeugend auf jegliche potentielle Bedrohungen für ihre Mission zu reagieren,
|
vorbeugend auf jegliche potentielle Bedrohungen für ihre Mission zu reagieren,
|
||||||
inklusive des sofortigen Eröffnens von Feuer auf Eindringlinge.
|
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
|
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
|
sección secreta de élite del Departamento de Ejecución de Directivas de
|
||||||
CONCORD. Sus oficiales están autorizados a responder preventivamente a
|
CONCORD. Sus oficiales están autorizados a responder preventivamente a
|
||||||
@@ -1696812,6 +1696819,8 @@
|
|||||||
description:
|
description:
|
||||||
de: Dieses fortschrittliche Schlachtschiff scheint die Kontrolle über das
|
de: Dieses fortschrittliche Schlachtschiff scheint die Kontrolle über das
|
||||||
lokale Schmugglerversteck zu haben. Es wird als extrem gefährlich eingestuft.
|
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
|
es: Este acorazado avanzado parece estar a cargo del escondite de los contrabandistas
|
||||||
locales. Debería considerarse extremadamente peligroso.
|
locales. Debería considerarse extremadamente peligroso.
|
||||||
fr: Ce cuirassé avancé semble être responsable de la cachette locale des contrebandiers.
|
fr: Ce cuirassé avancé semble être responsable de la cachette locale des contrebandiers.
|
||||||
|
|||||||
Reference in New Issue
Block a user