idac: fixed version correct database loading

This commit is contained in:
Dniel97 2024-07-25 21:39:13 +02:00
parent 8fbbfe3f37
commit 3ce2111f7f
Signed by untrusted user: Dniel97
GPG Key ID: 6180B3C768FB2E08
2 changed files with 9 additions and 7 deletions

View File

@ -346,7 +346,7 @@ class IDACItemData(BaseData):
car.c.version <= version,
car.c.style_car_id == style_car_id,
)
)
).order_by(car.c.version.desc())
result = await self.execute(sql)
if result is None:
@ -366,8 +366,10 @@ class IDACItemData(BaseData):
)
else:
sql = select(car).where(
and_(car.c.user == aime_id, car.c.version == version)
and_(car.c.user == aime_id, car.c.version <= version)
)
sql = sql.order_by(car.c.version.desc())
result = await self.execute(sql)
if result is None:

View File

@ -281,7 +281,7 @@ class IDACProfileData(BaseData):
profile.c.user == aime_id,
profile.c.version <= version,
)
)
).order_by(profile.c.version.desc())
result = await self.execute(sql)
if result is None:
@ -338,7 +338,7 @@ class IDACProfileData(BaseData):
rank.c.user == aime_id,
rank.c.version <= version,
)
)
).order_by(rank.c.version.desc())
result = await self.execute(sql)
if result is None:
@ -351,7 +351,7 @@ class IDACProfileData(BaseData):
stock.c.user == aime_id,
stock.c.version <= version,
)
)
).order_by(stock.c.version.desc())
result = await self.execute(sql)
if result is None:
@ -364,7 +364,7 @@ class IDACProfileData(BaseData):
theory.c.user == aime_id,
theory.c.version <= version,
)
)
).order_by(theory.c.version.desc())
result = await self.execute(sql)
if result is None:
@ -377,7 +377,7 @@ class IDACProfileData(BaseData):
tips.c.user == aime_id,
tips.c.version <= version,
)
)
).order_by(tips.c.version.desc())
result = await self.execute(sql)
if result is None: