feat: Separate asset origin type from content type for improved asset categorization and handling.

This commit is contained in:
xds
2026-02-07 14:41:03 +03:00
parent ce87ac7edb
commit 305ad24576
13 changed files with 53 additions and 17 deletions

View File

@@ -8,7 +8,7 @@ from aiogram.fsm.state import State, StatesGroup
from aiogram.types import *
from aiogram import Router, F, Bot
from models.Asset import Asset, AssetType
from models.Asset import Asset, AssetType, AssetContentType
from models.Character import Character
from repos.dao import DAO
@@ -74,7 +74,7 @@ async def new_char_bio(message: Message, state: FSMContext, dao: DAO, bot: Bot):
file_bytes = await bot.download_file(file_info.file_path)
file_io = file_bytes.read()
avatar_asset = await dao.assets.create_asset(
Asset(name="avatar.png", type=AssetType.IMAGE, linked_char_id=str(char.id), data=file_io,
Asset(name="avatar.png", type=AssetType.UPLOADED, content_type=AssetContentType.IMAGE, linked_char_id=str(char.id), data=file_io,
tg_doc_file_id=file_id))
char.avatar_image = avatar_asset.link
# Отправляем подтверждение