This commit is contained in:
kittentm 2026-03-15 00:23:03 +01:00
commit 9268538891
No known key found for this signature in database
GPG key ID: 520EDAA0C8CDE295
3 changed files with 16 additions and 15 deletions

View file

@ -4,17 +4,26 @@ const { connection } = require('../database');
const Equipment = connection.define('Equipment', {
PId: {
type: DataTypes.BIGINT,
allowNull: false
allowNull: false,
unique: 'unique_player_weapon'
},
weapon: {
type: DataTypes.INTEGER
type: DataTypes.INTEGER,
allowNull: false,
unique: 'unique_player_weapon'
},
sumpaint: {
type: DataTypes.INTEGER
}
}, {
tableName: 'equipment',
timestamps: true
timestamps: true,
indexes: [
{
unique: true,
fields: ['PId', 'weapon']
}
]
});
module.exports = { Equipment };

View file

@ -10,7 +10,7 @@ module.exports = {
create: async (data) => {
const result = await SplatfestResult.create(data);
await Equipment.create({
await Equipment.upsert({
PId: data.PId,
weapon: data.Weapon,
sumpaint: data.SumPaint

View file

@ -38,17 +38,9 @@ async def boss_rotation(request: Request):
with open("boss.yaml", "r") as f:
yaml_data = yaml.safe_load(f)
#temporary spfn patch lols
date_str = yaml_data.get("DateTime")
if not date_str:
date_str = "2023-10-30T07:00:00+09:00"
if isinstance(date_str, datetime):
current_time = date_str
else:
date_str = date_str.replace('Z', '+00:00')
current_time = datetime.fromisoformat(date_str)
base_time_str = yaml_data.get("ByamlInfo", {}).get("BaseByamlStartTime", "2026-02-06T06:00:00.0000000Z")
base_time_str = base_time_str.replace('Z', '+00:00')
current_time = datetime.fromisoformat(base_time_str)
rotations = {}