fix futures error + remove unused imports
All checks were successful
Build and Push Docker Image / build (push) Successful in 15s
All checks were successful
Build and Push Docker Image / build (push) Successful in 15s
This commit is contained in:
parent
d495ffc0fa
commit
8fecd43f31
@ -8,7 +8,6 @@ import asyncio
|
||||
from os import getenv
|
||||
from pathlib import Path
|
||||
|
||||
import aiofiles
|
||||
from rcon.source import rcon
|
||||
from discord.ext import commands, tasks
|
||||
|
||||
|
@ -6,16 +6,12 @@ import re
|
||||
import logging
|
||||
from os import getenv
|
||||
from pathlib import Path
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
|
||||
import httpx
|
||||
from discord import Embed, Colour
|
||||
from discord.ext import commands, tasks
|
||||
from rcon.source import rcon
|
||||
|
||||
from utils.reader import LogFileReader
|
||||
from utils.models import Player, PlayerDeath, create_or_update_player
|
||||
from utils.models import Player
|
||||
|
||||
ZOMBOID_FOLDER_PATH = Path(getenv("SPIFFO__ZOMBOID_FOLDER_PATH"))
|
||||
LOGS_FOLDER_PATH = ZOMBOID_FOLDER_PATH / "Logs"
|
||||
|
@ -4,7 +4,6 @@ Database schemas.
|
||||
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from __future__ import annotations
|
||||
|
||||
import httpx
|
||||
from tortoise import fields
|
||||
@ -15,6 +14,36 @@ from discord import Embed
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SteamProfileSummary(Model):
|
||||
player = fields.ForeignKeyField(
|
||||
model_name="models.Player",
|
||||
on_delete=fields.CASCADE
|
||||
)
|
||||
steam_id = fields.CharField(max_length=20, unique=True)
|
||||
profile_name = fields.CharField(max_length=32)
|
||||
url = fields.CharField(max_length=128)
|
||||
avatar_url = fields.CharField(max_length=128)
|
||||
last_update = fields.DatetimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
table = "steam_profile_summary"
|
||||
|
||||
|
||||
class PlayerDeath(Model):
|
||||
player = fields.ForeignKeyField(
|
||||
model_name="models.Player",
|
||||
on_delete=fields.CASCADE
|
||||
)
|
||||
coordinate_x = fields.IntField()
|
||||
coordinate_y = fields.IntField()
|
||||
coordinate_z = fields.IntField()
|
||||
cause = fields.CharField(max_length=32)
|
||||
timestamp = fields.DatetimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
table = "player_deaths"
|
||||
|
||||
|
||||
class Player(Model):
|
||||
"""
|
||||
"""
|
||||
@ -118,38 +147,3 @@ class Player(Model):
|
||||
)
|
||||
embed.set_thumbnail(summary.avatar_url)
|
||||
return embed
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class SteamProfileSummary(Model):
|
||||
player = fields.ForeignKeyField(
|
||||
model_name="models.Player",
|
||||
on_delete=fields.CASCADE
|
||||
)
|
||||
steam_id = fields.CharField(max_length=20, unique=True)
|
||||
profile_name = fields.CharField(max_length=32)
|
||||
url = fields.CharField(max_length=128)
|
||||
avatar_url = fields.CharField(max_length=128)
|
||||
last_update = fields.DatetimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
table = "steam_profile_summary"
|
||||
|
||||
|
||||
class PlayerDeath(Model):
|
||||
player = fields.ForeignKeyField(
|
||||
model_name="models.Player",
|
||||
on_delete=fields.CASCADE
|
||||
)
|
||||
coordinate_x = fields.IntField()
|
||||
coordinate_y = fields.IntField()
|
||||
coordinate_z = fields.IntField()
|
||||
cause = fields.CharField(max_length=32)
|
||||
timestamp = fields.DatetimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
table = "player_deaths"
|
||||
|
Reference in New Issue
Block a user